From f428e0b8484295ea025148297e3a422a47fbb2fc Mon Sep 17 00:00:00 2001 From: Daniel Morsing Date: Mon, 14 Jan 2019 15:48:16 +0000 Subject: [PATCH] only init globals data once This fixes the issue of global addons not being cleaned up after tests Signed-off-by: Daniel Morsing --- test/e2e/framework/addon/globals.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/e2e/framework/addon/globals.go b/test/e2e/framework/addon/globals.go index c14137c98..8839108d3 100644 --- a/test/e2e/framework/addon/globals.go +++ b/test/e2e/framework/addon/globals.go @@ -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,