Skip to content

Commit

Permalink
feat(deprecation): add deprecation warning for werf v1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-lesikov authored and alexey-igrychev committed Dec 16, 2021
1 parent 55b1fc9 commit 95718ad
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 1 deletion.
1 change: 0 additions & 1 deletion cmd/werf/build/main.go
Expand Up @@ -2,7 +2,6 @@ package build

import (
"github.com/spf13/cobra"

"github.com/werf/werf/cmd/werf/common"
stages_build "github.com/werf/werf/cmd/werf/stages/build/cmd_factory"
)
Expand Down
1 change: 1 addition & 0 deletions cmd/werf/build_and_publish/main.go
Expand Up @@ -120,6 +120,7 @@ func runBuildAndPublish(imagesToProcess []string) error {
ctx := common.BackgroundContext()

werf.PostponeMultiwerfNotUpToDateWarning()
werf.PostponeWerf11DeprecationWarning()

if err := werf.Init(*commonCmdData.TmpDir, *commonCmdData.HomeDir); err != nil {
return fmt.Errorf("initialization error: %s", err)
Expand Down
1 change: 1 addition & 0 deletions cmd/werf/converge/converge.go
Expand Up @@ -126,6 +126,7 @@ func runConverge() error {
ctx := common.BackgroundContext()

werf.PostponeMultiwerfNotUpToDateWarning()
werf.PostponeWerf11DeprecationWarning()

if err := werf.Init(*commonCmdData.TmpDir, *commonCmdData.HomeDir); err != nil {
return fmt.Errorf("initialization error: %s", err)
Expand Down
1 change: 1 addition & 0 deletions cmd/werf/deploy/main.go
Expand Up @@ -129,6 +129,7 @@ func runDeploy() error {
ctx := common.BackgroundContext()

werf.PostponeMultiwerfNotUpToDateWarning()
werf.PostponeWerf11DeprecationWarning()

if err := werf.Init(*commonCmdData.TmpDir, *commonCmdData.HomeDir); err != nil {
return fmt.Errorf("initialization error: %s", err)
Expand Down
1 change: 1 addition & 0 deletions cmd/werf/deploy_v2/main.go
Expand Up @@ -143,6 +143,7 @@ func runDeploy() error {
ctx := common.BackgroundContext()

werf.PostponeMultiwerfNotUpToDateWarning()
werf.PostponeWerf11DeprecationWarning()

if err := werf.Init(*commonCmdData.TmpDir, *commonCmdData.HomeDir); err != nil {
return fmt.Errorf("initialization error: %s", err)
Expand Down
1 change: 1 addition & 0 deletions cmd/werf/images/publish/cmd_factory/main.go
Expand Up @@ -90,6 +90,7 @@ func runImagesPublish(commonCmdData *common.CmdData, imagesToProcess []string) e
ctx := common.BackgroundContext()

werf.PostponeMultiwerfNotUpToDateWarning()
werf.PostponeWerf11DeprecationWarning()

if err := werf.Init(*commonCmdData.TmpDir, *commonCmdData.HomeDir); err != nil {
return fmt.Errorf("initialization error: %s", err)
Expand Down
1 change: 1 addition & 0 deletions cmd/werf/run/run.go
Expand Up @@ -169,6 +169,7 @@ func runRun() error {
ctx := common.BackgroundContext()

werf.PostponeMultiwerfNotUpToDateWarning()
werf.PostponeWerf11DeprecationWarning()

if err := werf.Init(*commonCmdData.TmpDir, *commonCmdData.HomeDir); err != nil {
return fmt.Errorf("initialization error: %s", err)
Expand Down
1 change: 1 addition & 0 deletions cmd/werf/stages/build/cmd_factory/main.go
Expand Up @@ -108,6 +108,7 @@ func runStagesBuild(cmdData *CmdData, commonCmdData *common.CmdData, imagesToPro
ctx := common.BackgroundContext()

werf.PostponeMultiwerfNotUpToDateWarning()
werf.PostponeWerf11DeprecationWarning()

if err := werf.Init(*commonCmdData.TmpDir, *commonCmdData.HomeDir); err != nil {
return fmt.Errorf("initialization error: %s", err)
Expand Down
8 changes: 8 additions & 0 deletions pkg/werf/global_warnings.go
Expand Up @@ -78,6 +78,14 @@ func PostponeMultiwerfNotUpToDateWarning() {
)
}

func PostponeWerf11DeprecationWarning() {
GlobalWarningLines = append(
GlobalWarningLines,
"werf v1.1 is DEPRECATED. Consider switching to the more recent version of werf: https://werf.io/installation.html",
"No support and no updates will be provided for werf v1.1 after July 1, 2022.",
)
}

func printGlobalWarningLn(ctx context.Context, line string) {
logboek.Context(ctx).Error().LogF("WARNING: %s\n", line)
}

0 comments on commit 95718ad

Please sign in to comment.