From fa94f6b94226f77053e1d8734b0dc781be9b21a1 Mon Sep 17 00:00:00 2001 From: Sam Stoelinga Date: Tue, 7 Jan 2020 09:46:25 -0800 Subject: [PATCH] Fix #950 integration test failing on go 1.13 From Golang 1.13 release notes: Testing flags are now registered in the new Init function, which is invoked by the generated main function for the test. As a result, testing flags are now only registered when running a test binary, and packages that call flag.Parse during package initialization may cause tests to fail. --- integration/integration_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/integration/integration_test.go b/integration/integration_test.go index 246e9e6cb..d1dd9c8c8 100644 --- a/integration/integration_test.go +++ b/integration/integration_test.go @@ -38,7 +38,7 @@ import ( "github.com/GoogleContainerTools/kaniko/testutil" ) -var config = initGCPConfig() +var config *gcpConfig var imageBuilder *DockerFileBuilder const ( @@ -72,6 +72,7 @@ func TestMain(m *testing.M) { fmt.Println("Missing required tools") os.Exit(1) } + config = initGCPConfig() contextFile, err := CreateIntegrationTarball() if err != nil { fmt.Println("Failed to create tarball of integration files for build context", err)