Skip to content

Commit

Permalink
InsecureRegistry to InsecureRegistries
Browse files Browse the repository at this point in the history
Signed-off-by: Domenico Luciani <[email protected]>
  • Loading branch information
Domenico Luciani committed Aug 7, 2023
1 parent ea1f04b commit bbbbe1a
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion cmd/lifecycle/analyzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
4 changes: 2 additions & 2 deletions cmd/lifecycle/cli/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions cmd/lifecycle/creator.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down
14 changes: 7 additions & 7 deletions platform/lifecycle_inputs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "<layers>"
Expand All @@ -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

Expand Down
4 changes: 2 additions & 2 deletions platform/lifecycle_inputs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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))
})
})

Expand Down

0 comments on commit bbbbe1a

Please sign in to comment.