Skip to content

Commit 4c47cbc

Browse files
author
Domenico Luciani
committed
Added cli flags behind proper guards
Signed-off-by: Domenico Luciani <[email protected]>
1 parent c16b038 commit 4c47cbc

File tree

7 files changed

+8
-8
lines changed

7 files changed

+8
-8
lines changed

acceptance/detector_test.go

-3
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@ func TestDetector(t *testing.T) {
3636
info, err := h.DockerCli(t).Info(context.TODO())
3737
h.AssertNil(t, err)
3838

39-
// These variables are clones of the variables in analyzer_test.go.
40-
// You can find the same variables there without `builder` prefix.
41-
// These lines are added for supporting windows tests.
4239
detectorDaemonOS = info.OSType
4340
detectorDaemonArch = info.Architecture
4441
if detectorDaemonArch == "x86_64" {

acceptance/rebaser_test.go

+3
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ func TestRebaser(t *testing.T) {
3737
func testRebaser(platformAPI string) func(t *testing.T, when spec.G, it spec.S) {
3838
return func(t *testing.T, when spec.G, it spec.S) {
3939
when("called with insecure registry flag", func() {
40+
it.Before(func() {
41+
h.SkipIf(t, api.MustParse(platformAPI).LessThan("0.12"), "")
42+
})
4043
it("should do an http request", func() {
4144
insecureRegistry := "host.docker.internal"
4245
rebaserOutputImageName := insecureRegistry + "/bar"

cmd/lifecycle/analyzer.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ func (a *analyzeCmd) DefineFlags() {
4040
cli.FlagLayoutDir(&a.LayoutDir)
4141
cli.FlagUseLayout(&a.UseLayout)
4242
cli.FlagRunPath(&a.RunPath)
43+
cli.FlagInsecureRegistries(&a.InsecureRegistries)
4344
fallthrough
4445
case a.PlatformAPI.AtLeast("0.9"):
4546
cli.FlagLaunchCacheDir(&a.LaunchCacheDir)
@@ -58,7 +59,6 @@ func (a *analyzeCmd) DefineFlags() {
5859
cli.FlagUID(&a.UID)
5960
cli.FlagUseDaemon(&a.UseDaemon)
6061
}
61-
cli.FlagInsecureRegistries(&a.InsecureRegistries)
6262
}
6363

6464
// Args validates arguments and flags, and fills in default values.

cmd/lifecycle/creator.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ func (c *createCmd) DefineFlags() {
3434
cli.FlagLayoutDir(&c.LayoutDir)
3535
cli.FlagUseLayout(&c.UseLayout)
3636
cli.FlagRunPath(&c.RunPath)
37+
cli.FlagInsecureRegistries(&c.InsecureRegistries)
3738
}
3839
if c.PlatformAPI.AtLeast("0.11") {
3940
cli.FlagBuildConfigDir(&c.BuildConfigDir)
@@ -59,7 +60,6 @@ func (c *createCmd) DefineFlags() {
5960
cli.FlagTags(&c.AdditionalTags)
6061
cli.FlagUID(&c.UID)
6162
cli.FlagUseDaemon(&c.UseDaemon)
62-
cli.FlagInsecureRegistries(&c.InsecureRegistries)
6363
}
6464

6565
// Args validates arguments and flags, and fills in default values.

cmd/lifecycle/exporter.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ func (e *exportCmd) DefineFlags() {
5555
cli.FlagLayoutDir(&e.LayoutDir)
5656
cli.FlagRunPath(&e.RunPath)
5757
cli.FlagUseLayout(&e.UseLayout)
58+
cli.FlagInsecureRegistries(&e.InsecureRegistries)
5859
} else {
5960
cli.FlagStackPath(&e.StackPath)
6061
}
@@ -76,7 +77,6 @@ func (e *exportCmd) DefineFlags() {
7677
cli.FlagRunImage(&e.RunImageRef) // FIXME: this flag isn't valid on Platform 0.7 and later
7778
cli.FlagUID(&e.UID)
7879
cli.FlagUseDaemon(&e.UseDaemon)
79-
cli.FlagInsecureRegistries(&e.InsecureRegistries)
8080

8181
cli.DeprecatedFlagRunImage(&e.DeprecatedRunImageRef) // FIXME: this flag isn't valid on Platform 0.7 and later
8282
}

cmd/lifecycle/rebaser.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ func (r *rebaseCmd) DefineFlags() {
4040
cli.FlagUID(&r.UID)
4141
cli.FlagUseDaemon(&r.UseDaemon)
4242
cli.DeprecatedFlagRunImage(&r.DeprecatedRunImageRef)
43-
cli.FlagInsecureRegistries(&r.InsecureRegistries)
4443

4544
if r.PlatformAPI.AtLeast("0.11") {
4645
cli.FlagPreviousImage(&r.PreviousImageRef)
4746
}
4847

4948
if r.PlatformAPI.AtLeast("0.12") {
5049
cli.FlagForceRebase(&r.ForceRebase)
50+
cli.FlagInsecureRegistries(&r.InsecureRegistries)
5151
}
5252
}
5353

cmd/lifecycle/restorer.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ func (r *restoreCmd) DefineFlags() {
4141
if r.PlatformAPI.AtLeast("0.12") {
4242
cli.FlagUseDaemon(&r.UseDaemon)
4343
cli.FlagGeneratedDir(&r.GeneratedDir)
44+
cli.FlagInsecureRegistries(&r.InsecureRegistries)
4445
}
4546
if r.PlatformAPI.AtLeast("0.10") {
4647
cli.FlagBuildImage(&r.BuildImageRef)
@@ -55,7 +56,6 @@ func (r *restoreCmd) DefineFlags() {
5556
cli.FlagGroupPath(&r.GroupPath)
5657
cli.FlagLayersDir(&r.LayersDir)
5758
cli.FlagUID(&r.UID)
58-
cli.FlagInsecureRegistries(&r.InsecureRegistries)
5959
}
6060

6161
// Args validates arguments and flags, and fills in default values.

0 commit comments

Comments
 (0)