only init globals data once

This fixes the issue of global addons not being cleaned up after tests

Signed-off-by: Daniel Morsing <dmo@jetstack.io>
This commit is contained in:
Daniel Morsing 2019-01-14 15:48:16 +00:00
parent e67e4f08ed
commit f428e0b848

View File

@ -59,10 +59,16 @@ var (
provisioned []Addon
)
var globalsInited = false
// InitGlobals actually allocates the addon values that are defined above.
// We do this here so that we can access the suites config structure during
// the definition of global addons.
func InitGlobals(cfg *config.Config) {
if globalsInited {
return
}
globalsInited = true
*Base = base.Base{}
*Tiller = tiller.Tiller{
Base: Base,