Skip to content

Commit

Permalink
feat(v2): remove deprecated --skip-build option
Browse files Browse the repository at this point in the history
Signed-off-by: Ilya Lesikov <ilya@lesikov.com>
  • Loading branch information
ilya-lesikov committed Apr 24, 2024
1 parent ded7731 commit 14d1c72
Show file tree
Hide file tree
Showing 10 changed files with 1 addition and 22 deletions.
1 change: 0 additions & 1 deletion cmd/werf/bundle/publish/publish.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ func NewCmd(ctx context.Context) *cobra.Command {
common.SetupAllowedLocalCacheVolumeUsageMargin(&commonCmdData, cmd)
common.SetupDockerServerStoragePath(&commonCmdData, cmd)

common.SetupSkipBuild(&commonCmdData, cmd)
common.SetupRequireBuiltImages(&commonCmdData, cmd)
commonCmdData.SetupPlatform(cmd)

Expand Down
1 change: 0 additions & 1 deletion cmd/werf/common/cmd_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ type CmdData struct {
SecondaryStagesStorage *[]string
CacheStagesStorage *[]string

SkipBuild *bool
RequireBuiltImages *bool
StubTags *bool

Expand Down
14 changes: 1 addition & 13 deletions cmd/werf/common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -873,14 +873,6 @@ IMAGE_NAME is the name of an image or artifact described in werf.yaml, the namel
STAGE_NAME should be one of the following: `+strings.Join(allStagesNames(), ", "))
}

// SetupSkipBuild
// Deprecated. See [SetupRequireBuiltImages].
func SetupSkipBuild(cmdData *CmdData, cmd *cobra.Command) {
cmdData.SkipBuild = new(bool)
cmd.Flags().BoolVarP(cmdData.SkipBuild, "skip-build", "", util.GetBoolEnvironmentDefaultFalse("WERF_SKIP_BUILD"), "DEPRECATED: use --require-built-images.")
_ = cmd.Flags().MarkHidden("skip-build")
}

// SetupRequireBuiltImages adds --require-built-images flag.
// See also [quireBuiltImages].
func SetupRequireBuiltImages(cmdData *CmdData, cmd *cobra.Command) {
Expand Down Expand Up @@ -1271,11 +1263,7 @@ func GetRequireBuiltImages(ctx context.Context, cmdData *CmdData) bool {
if cmdData.RequireBuiltImages != nil && *cmdData.RequireBuiltImages {
return true
}
// Support for deprecated option.
if cmdData.SkipBuild != nil && *cmdData.SkipBuild {
logboek.Context(ctx).Warn().LogF("DEPRECATED: use --require-built-images ($WERF_REQUIRE_BUILT_IMAGES) instead of --skip-build\n")
return true
}

return false
}

Expand Down
1 change: 0 additions & 1 deletion cmd/werf/compose/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,6 @@ func newCmd(ctx context.Context, composeCmdName string, options *newCmdOptions)
common.SetupRepoOptions(&commonCmdData, cmd, common.RepoDataOptions{OptionalRepo: true})
common.SetupFinalRepo(&commonCmdData, cmd)

common.SetupSkipBuild(&commonCmdData, cmd)
common.SetupRequireBuiltImages(&commonCmdData, cmd)

if options.FollowSupport {
Expand Down
1 change: 0 additions & 1 deletion cmd/werf/converge/converge.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ werf converge --repo registry.mydomain.com/web --env production`,
common.SetupVirtualMerge(&commonCmdData, cmd)

common.SetupParallelOptions(&commonCmdData, cmd, common.DefaultBuildParallelTasksLimit)
common.SetupSkipBuild(&commonCmdData, cmd)
common.SetupRequireBuiltImages(&commonCmdData, cmd)
commonCmdData.SetupPlatform(cmd)
common.SetupFollow(&commonCmdData, cmd)
Expand Down
1 change: 0 additions & 1 deletion cmd/werf/export/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ func NewExportCmd(ctx context.Context) *cobra.Command {
common.SetupRepoOptions(&commonCmdData, cmd, common.RepoDataOptions{OptionalRepo: true})
common.SetupFinalRepo(&commonCmdData, cmd)

common.SetupSkipBuild(&commonCmdData, cmd)
common.SetupRequireBuiltImages(&commonCmdData, cmd)

common.SetupDockerConfig(&commonCmdData, cmd, "Command needs granted permissions to read and pull images from the specified repo")
Expand Down
1 change: 0 additions & 1 deletion cmd/werf/kube_run/kube_run.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ func NewCmd(ctx context.Context) *cobra.Command {
common.SetupRepoOptions(&commonCmdData, cmd, common.RepoDataOptions{})
common.SetupFinalRepo(&commonCmdData, cmd)

common.SetupSkipBuild(&commonCmdData, cmd)
common.SetupRequireBuiltImages(&commonCmdData, cmd)

common.SetupFollow(&commonCmdData, cmd)
Expand Down
1 change: 0 additions & 1 deletion cmd/werf/plan/plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ werf plan --repo registry.mydomain.com/web --env production`,
common.SetupVirtualMerge(&commonCmdData, cmd)

common.SetupParallelOptions(&commonCmdData, cmd, common.DefaultBuildParallelTasksLimit)
common.SetupSkipBuild(&commonCmdData, cmd)
common.SetupRequireBuiltImages(&commonCmdData, cmd)
commonCmdData.SetupPlatform(cmd)
common.SetupFollow(&commonCmdData, cmd)
Expand Down
1 change: 0 additions & 1 deletion cmd/werf/render/render.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ func NewCmd(ctx context.Context) *cobra.Command {

common.SetupParallelOptions(&commonCmdData, cmd, common.DefaultBuildParallelTasksLimit)

common.SetupSkipBuild(&commonCmdData, cmd)
common.SetupRequireBuiltImages(&commonCmdData, cmd)
commonCmdData.SetupPlatform(cmd)

Expand Down
1 change: 0 additions & 1 deletion cmd/werf/run/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ func NewCmd(ctx context.Context) *cobra.Command {
common.SetupRepoOptions(&commonCmdData, cmd, common.RepoDataOptions{OptionalRepo: true})
common.SetupFinalRepo(&commonCmdData, cmd)

common.SetupSkipBuild(&commonCmdData, cmd)
common.SetupRequireBuiltImages(&commonCmdData, cmd)

common.SetupFollow(&commonCmdData, cmd)
Expand Down

0 comments on commit 14d1c72

Please sign in to comment.