diff --git a/acceptance/detector_test.go b/acceptance/detector_test.go index 285e4885a..49a747b43 100644 --- a/acceptance/detector_test.go +++ b/acceptance/detector_test.go @@ -36,9 +36,6 @@ func TestDetector(t *testing.T) { info, err := h.DockerCli(t).Info(context.TODO()) h.AssertNil(t, err) - // These variables are clones of the variables in analyzer_test.go. - // You can find the same variables there without `builder` prefix. - // These lines are added for supporting windows tests. detectorDaemonOS = info.OSType detectorDaemonArch = info.Architecture if detectorDaemonArch == "x86_64" { diff --git a/acceptance/rebaser_test.go b/acceptance/rebaser_test.go index 11fbe13c4..d0dfa95ae 100644 --- a/acceptance/rebaser_test.go +++ b/acceptance/rebaser_test.go @@ -37,6 +37,9 @@ func TestRebaser(t *testing.T) { func testRebaser(platformAPI string) func(t *testing.T, when spec.G, it spec.S) { return func(t *testing.T, when spec.G, it spec.S) { when("called with insecure registry flag", func() { + it.Before(func() { + h.SkipIf(t, api.MustParse(platformAPI).LessThan("0.12"), "") + }) it("should do an http request", func() { insecureRegistry := "host.docker.internal" rebaserOutputImageName := insecureRegistry + "/bar" diff --git a/cmd/lifecycle/analyzer.go b/cmd/lifecycle/analyzer.go index c2ed77b50..b36d79d45 100644 --- a/cmd/lifecycle/analyzer.go +++ b/cmd/lifecycle/analyzer.go @@ -40,6 +40,7 @@ func (a *analyzeCmd) DefineFlags() { cli.FlagLayoutDir(&a.LayoutDir) cli.FlagUseLayout(&a.UseLayout) cli.FlagRunPath(&a.RunPath) + cli.FlagInsecureRegistries(&a.InsecureRegistries) fallthrough case a.PlatformAPI.AtLeast("0.9"): cli.FlagLaunchCacheDir(&a.LaunchCacheDir) @@ -58,7 +59,6 @@ func (a *analyzeCmd) DefineFlags() { cli.FlagUID(&a.UID) cli.FlagUseDaemon(&a.UseDaemon) } - cli.FlagInsecureRegistries(&a.InsecureRegistries) } // Args validates arguments and flags, and fills in default values. diff --git a/cmd/lifecycle/creator.go b/cmd/lifecycle/creator.go index 4d4497b80..7c95020bc 100644 --- a/cmd/lifecycle/creator.go +++ b/cmd/lifecycle/creator.go @@ -34,6 +34,7 @@ func (c *createCmd) DefineFlags() { cli.FlagLayoutDir(&c.LayoutDir) cli.FlagUseLayout(&c.UseLayout) cli.FlagRunPath(&c.RunPath) + cli.FlagInsecureRegistries(&c.InsecureRegistries) } if c.PlatformAPI.AtLeast("0.11") { cli.FlagBuildConfigDir(&c.BuildConfigDir) @@ -59,7 +60,6 @@ func (c *createCmd) DefineFlags() { cli.FlagTags(&c.AdditionalTags) cli.FlagUID(&c.UID) cli.FlagUseDaemon(&c.UseDaemon) - cli.FlagInsecureRegistries(&c.InsecureRegistries) } // Args validates arguments and flags, and fills in default values. diff --git a/cmd/lifecycle/exporter.go b/cmd/lifecycle/exporter.go index 6e69ab26c..cfee37ef8 100644 --- a/cmd/lifecycle/exporter.go +++ b/cmd/lifecycle/exporter.go @@ -55,6 +55,7 @@ func (e *exportCmd) DefineFlags() { cli.FlagLayoutDir(&e.LayoutDir) cli.FlagRunPath(&e.RunPath) cli.FlagUseLayout(&e.UseLayout) + cli.FlagInsecureRegistries(&e.InsecureRegistries) } else { cli.FlagStackPath(&e.StackPath) } @@ -76,7 +77,6 @@ func (e *exportCmd) DefineFlags() { cli.FlagRunImage(&e.RunImageRef) // FIXME: this flag isn't valid on Platform 0.7 and later cli.FlagUID(&e.UID) cli.FlagUseDaemon(&e.UseDaemon) - cli.FlagInsecureRegistries(&e.InsecureRegistries) cli.DeprecatedFlagRunImage(&e.DeprecatedRunImageRef) // FIXME: this flag isn't valid on Platform 0.7 and later } diff --git a/cmd/lifecycle/rebaser.go b/cmd/lifecycle/rebaser.go index 45936e0e1..659a07583 100644 --- a/cmd/lifecycle/rebaser.go +++ b/cmd/lifecycle/rebaser.go @@ -40,7 +40,6 @@ func (r *rebaseCmd) DefineFlags() { cli.FlagUID(&r.UID) cli.FlagUseDaemon(&r.UseDaemon) cli.DeprecatedFlagRunImage(&r.DeprecatedRunImageRef) - cli.FlagInsecureRegistries(&r.InsecureRegistries) if r.PlatformAPI.AtLeast("0.11") { cli.FlagPreviousImage(&r.PreviousImageRef) @@ -48,6 +47,7 @@ func (r *rebaseCmd) DefineFlags() { if r.PlatformAPI.AtLeast("0.12") { cli.FlagForceRebase(&r.ForceRebase) + cli.FlagInsecureRegistries(&r.InsecureRegistries) } } diff --git a/cmd/lifecycle/restorer.go b/cmd/lifecycle/restorer.go index cce1222e2..16aca14e6 100644 --- a/cmd/lifecycle/restorer.go +++ b/cmd/lifecycle/restorer.go @@ -43,6 +43,7 @@ func (r *restoreCmd) DefineFlags() { cli.FlagGeneratedDir(&r.GeneratedDir) cli.FlagUseLayout(&r.UseLayout) cli.FlagLayoutDir(&r.LayoutDir) + cli.FlagInsecureRegistries(&r.InsecureRegistries) } if r.PlatformAPI.AtLeast("0.10") { cli.FlagBuildImage(&r.BuildImageRef) @@ -57,7 +58,6 @@ func (r *restoreCmd) DefineFlags() { cli.FlagGroupPath(&r.GroupPath) cli.FlagLayersDir(&r.LayersDir) cli.FlagUID(&r.UID) - cli.FlagInsecureRegistries(&r.InsecureRegistries) } // Args validates arguments and flags, and fills in default values.