Skip to content

Commit

Permalink
feat(nelm): switch back to the old deployment engine by default
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 9, 2024
1 parent 6fc7550 commit 439b0d4
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 24 deletions.
12 changes: 8 additions & 4 deletions cmd/werf/plan/plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,7 @@ werf plan --repo registry.mydomain.com/web --env production`,
common.SetupAllowedLocalCacheVolumeUsageMargin(&commonCmdData, cmd)
common.SetupDockerServerStoragePath(&commonCmdData, cmd)

if helm.IsExperimentalEngine() {
common.SetupNetworkParallelism(&commonCmdData, cmd)
}
common.SetupNetworkParallelism(&commonCmdData, cmd)

defaultTimeout, err := util.GetIntEnvVar("WERF_TIMEOUT")
if err != nil || defaultTimeout == nil {
Expand All @@ -213,6 +211,12 @@ werf plan --repo registry.mydomain.com/web --env production`,

func runMain(ctx context.Context, imagesToProcess build.ImagesToProcess) error {
global_warnings.PostponeMultiwerfNotUpToDateWarning()
if !helm.IsExperimentalEngine() {
global_warnings.GlobalWarningLines = append(
global_warnings.GlobalWarningLines,
`"werf plan" shows planned changes for the new deployment engine. Currently you are using the old engine, which might produce different results during deployment. If you want to use "werf plan" we strongly advice migrating to the new engine by setting environment variable "WERF_NELM=1".`,
)
}

if err := werf.Init(*commonCmdData.TmpDir, *commonCmdData.HomeDir); err != nil {
return fmt.Errorf("initialization error: %w", err)
Expand Down Expand Up @@ -504,7 +508,7 @@ func run(ctx context.Context, containerBackend container_backend.ContainerBacken
return err
}

if helm.IsExperimentalEngine() {
if true {
networkParallelism := common.GetNetworkParallelism(&commonCmdData)
serviceAnnotations := map[string]string{
"werf.io/version": werf.Version,
Expand Down
26 changes: 7 additions & 19 deletions cmd/werf/root/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ import (
stage_image "github.com/werf/werf/cmd/werf/stage/image"
"github.com/werf/werf/cmd/werf/synchronization"
"github.com/werf/werf/cmd/werf/version"
dhelm "github.com/werf/werf/pkg/deploy/helm"
"github.com/werf/werf/pkg/telemetry"
)

Expand All @@ -71,27 +70,16 @@ Find more information at https://werf.io`),
SilenceErrors: true,
})

var deliveryCmds []*cobra.Command
if dhelm.IsExperimentalEngine() {
deliveryCmds = []*cobra.Command{
converge.NewCmd(ctx),
plan.NewCmd(ctx),
dismiss.NewCmd(ctx),
bundleCmd(ctx),
}
} else {
deliveryCmds = []*cobra.Command{
converge.NewCmd(ctx),
dismiss.NewCmd(ctx),
bundleCmd(ctx),
}
}

groups := &templates.CommandGroups{}
*groups = append(*groups, templates.CommandGroups{
{
Message: "Delivery commands",
Commands: deliveryCmds,
Message: "Delivery commands",
Commands: []*cobra.Command{
converge.NewCmd(ctx),
plan.NewCmd(ctx),
dismiss.NewCmd(ctx),
bundleCmd(ctx),
},
},
{
Message: "Cleaning commands",
Expand Down
2 changes: 1 addition & 1 deletion pkg/deploy/helm/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func IsExperimentalEngine() bool {
return *isNelm
}

return true
return false
}

type InitActionConfigOptions struct {
Expand Down

0 comments on commit 439b0d4

Please sign in to comment.