diff --git a/cmd/lifecycle/analyzer.go b/cmd/lifecycle/analyzer.go index f1c57e9f0..4b29dcc35 100644 --- a/cmd/lifecycle/analyzer.go +++ b/cmd/lifecycle/analyzer.go @@ -107,7 +107,7 @@ func (a *analyzeCmd) Exec() error { &cmd.BuildpackAPIVerifier{}, NewCacheHandler(a.keychain), lifecycle.NewConfigHandler(), - image.NewHandler(a.docker, a.keychain, a.LayoutDir, a.UseLayout, a.InsecureRegistry), + image.NewHandler(a.docker, a.keychain, a.LayoutDir, a.UseLayout, a.InsecureRegistries), NewRegistryHandler(a.keychain), ) analyzer, err := factory.NewAnalyzer( diff --git a/cmd/lifecycle/cli/flags.go b/cmd/lifecycle/cli/flags.go index 3b44031ff..72ce7916a 100644 --- a/cmd/lifecycle/cli/flags.go +++ b/cmd/lifecycle/cli/flags.go @@ -169,8 +169,8 @@ func FlagForceRebase(force *bool) { } // FlagInsecureRegistry sets insecure-registry parameter as available -func FlagInsecureRegistry(insecureRegistry *str.Slice) { - flagSet.Var(insecureRegistry, "insecure-registry", "to use 'insecure' registries") +func FlagInsecureRegistry(insecureRegistries *str.Slice) { + flagSet.Var(insecureRegistries, "insecure-registry", "to use 'insecure' registries") } // deprecated diff --git a/cmd/lifecycle/creator.go b/cmd/lifecycle/creator.go index 2e558e3fd..12aa8a8df 100644 --- a/cmd/lifecycle/creator.go +++ b/cmd/lifecycle/creator.go @@ -59,7 +59,7 @@ func (c *createCmd) DefineFlags() { cli.FlagTags(&c.AdditionalTags) cli.FlagUID(&c.UID) cli.FlagUseDaemon(&c.UseDaemon) - cli.FlagInsecureRegistry(&c.InsecureRegistry) + cli.FlagInsecureRegistry(&c.InsecureRegistries) } // Args validates arguments and flags, and fills in default values. @@ -126,7 +126,7 @@ func (c *createCmd) Exec() error { &cmd.BuildpackAPIVerifier{}, NewCacheHandler(c.keychain), lifecycle.NewConfigHandler(), - image.NewHandler(c.docker, c.keychain, c.LayoutDir, c.UseLayout, c.InsecureRegistry), + image.NewHandler(c.docker, c.keychain, c.LayoutDir, c.UseLayout, c.InsecureRegistries), NewRegistryHandler(c.keychain), ) analyzer, err := analyzerFactory.NewAnalyzer( @@ -189,7 +189,7 @@ func (c *createCmd) Exec() error { &cmd.BuildpackAPIVerifier{}, NewCacheHandler(c.keychain), lifecycle.NewConfigHandler(), - image.NewHandler(c.docker, c.keychain, c.LayoutDir, c.UseLayout, c.InsecureRegistry), + image.NewHandler(c.docker, c.keychain, c.LayoutDir, c.UseLayout, c.InsecureRegistries), NewRegistryHandler(c.keychain), ) analyzer, err := analyzerFactory.NewAnalyzer( diff --git a/platform/lifecycle_inputs.go b/platform/lifecycle_inputs.go index 06fae562b..9ba95d675 100644 --- a/platform/lifecycle_inputs.go +++ b/platform/lifecycle_inputs.go @@ -59,7 +59,7 @@ type LifecycleInputs struct { UseLayout bool AdditionalTags str.Slice // str.Slice satisfies the `Value` interface required by the `flag` package KanikoCacheTTL time.Duration - InsecureRegistry str.Slice + InsecureRegistries str.Slice } const PlaceholderLayers = "" @@ -86,12 +86,12 @@ func NewLifecycleInputs(platformAPI *api.Version) *LifecycleInputs { inputs := &LifecycleInputs{ // Operator config - LogLevel: envOrDefault(EnvLogLevel, DefaultLogLevel), - PlatformAPI: platformAPI, - ExtendKind: envOrDefault(EnvExtendKind, DefaultExtendKind), - UseDaemon: boolEnv(EnvUseDaemon), - InsecureRegistry: nil, - UseLayout: boolEnv(EnvUseLayout), + LogLevel: envOrDefault(EnvLogLevel, DefaultLogLevel), + PlatformAPI: platformAPI, + ExtendKind: envOrDefault(EnvExtendKind, DefaultExtendKind), + UseDaemon: boolEnv(EnvUseDaemon), + InsecureRegistries: nil, + UseLayout: boolEnv(EnvUseLayout), // Provided by the base image diff --git a/platform/lifecycle_inputs_test.go b/platform/lifecycle_inputs_test.go index 8f0d81ba8..cd54d69a0 100644 --- a/platform/lifecycle_inputs_test.go +++ b/platform/lifecycle_inputs_test.go @@ -61,7 +61,7 @@ func testLifecycleInputs(t *testing.T, when spec.G, it spec.S) { h.AssertEq(t, inputs.UID, 0) h.AssertEq(t, inputs.UseDaemon, false) h.AssertEq(t, inputs.UseLayout, false) - h.AssertEq(t, inputs.InsecureRegistry, str.Slice(nil)) + h.AssertEq(t, inputs.InsecureRegistries, str.Slice(nil)) }) when("env vars are set", func() { @@ -175,7 +175,7 @@ func testLifecycleInputs(t *testing.T, when spec.G, it spec.S) { h.AssertEq(t, inputs.UID, 1234) h.AssertEq(t, inputs.UseDaemon, true) h.AssertEq(t, inputs.UseLayout, true) - h.AssertEq(t, inputs.InsecureRegistry, str.Slice(nil)) + h.AssertEq(t, inputs.InsecureRegistries, str.Slice(nil)) }) })