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.
This commit is contained in:
parent
3b6411d83f
commit
fa94f6b942
|
|
@ -38,7 +38,7 @@ import (
|
||||||
"github.com/GoogleContainerTools/kaniko/testutil"
|
"github.com/GoogleContainerTools/kaniko/testutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
var config = initGCPConfig()
|
var config *gcpConfig
|
||||||
var imageBuilder *DockerFileBuilder
|
var imageBuilder *DockerFileBuilder
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
@ -72,6 +72,7 @@ func TestMain(m *testing.M) {
|
||||||
fmt.Println("Missing required tools")
|
fmt.Println("Missing required tools")
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
config = initGCPConfig()
|
||||||
contextFile, err := CreateIntegrationTarball()
|
contextFile, err := CreateIntegrationTarball()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("Failed to create tarball of integration files for build context", err)
|
fmt.Println("Failed to create tarball of integration files for build context", err)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue