Skip to content

Commit

Permalink
Add FlagInsecureRegistries behind 0.13 guards
Browse files Browse the repository at this point in the history
Signed-off-by: Domenico Luciani <[email protected]>
  • Loading branch information
Domenico Luciani committed Sep 22, 2023
1 parent eb4dad1 commit 1ac4480
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 2 deletions.
4 changes: 3 additions & 1 deletion cmd/lifecycle/analyzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,13 @@ func (a *analyzeCmd) DefineFlags() {
cli.FlagStackPath(&a.StackPath)
}
switch {
case a.PlatformAPI.AtLeast("0.13"):
cli.FlagInsecureRegistries(&a.InsecureRegistries)
fallthrough
case a.PlatformAPI.AtLeast("0.12"):
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)
Expand Down
4 changes: 4 additions & 0 deletions cmd/lifecycle/creator.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,12 @@ func (c *createCmd) DefineFlags() {
cli.FlagLayoutDir(&c.LayoutDir)
cli.FlagUseLayout(&c.UseLayout)
cli.FlagRunPath(&c.RunPath)
}

if c.PlatformAPI.AtLeast("0.13") {
cli.FlagInsecureRegistries(&c.InsecureRegistries)
}

if c.PlatformAPI.AtLeast("0.11") {
cli.FlagBuildConfigDir(&c.BuildConfigDir)
cli.FlagLauncherSBOMDir(&c.LauncherSBOMDir)
Expand Down
6 changes: 5 additions & 1 deletion cmd/lifecycle/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,14 @@ 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)
}

if e.PlatformAPI.AtLeast("0.13") {
cli.FlagInsecureRegistries(&e.InsecureRegistries)
}

if e.PlatformAPI.AtLeast("0.11") {
cli.FlagLauncherSBOMDir(&e.LauncherSBOMDir)
}
Expand Down
3 changes: 3 additions & 0 deletions cmd/lifecycle/rebaser.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ func (r *rebaseCmd) DefineFlags() {

if r.PlatformAPI.AtLeast("0.12") {
cli.FlagForceRebase(&r.ForceRebase)
}

if r.PlatformAPI.AtLeast("0.13") {
cli.FlagInsecureRegistries(&r.InsecureRegistries)
}
}
Expand Down
5 changes: 5 additions & 0 deletions cmd/lifecycle/restorer.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,16 @@ func (r *restoreCmd) DefineFlags() {
cli.FlagGeneratedDir(&r.GeneratedDir)
cli.FlagUseLayout(&r.UseLayout)
cli.FlagLayoutDir(&r.LayoutDir)
}

if r.PlatformAPI.AtLeast("0.13") {
cli.FlagInsecureRegistries(&r.InsecureRegistries)
}

if r.PlatformAPI.AtLeast("0.10") {
cli.FlagBuildImage(&r.BuildImageRef)
}

cli.FlagAnalyzedPath(&r.AnalyzedPath)
cli.FlagCacheDir(&r.CacheDir)
cli.FlagCacheImage(&r.CacheImageRef)
Expand Down

0 comments on commit 1ac4480

Please sign in to comment.