Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix(telemetry): experimental deploy engine attribute
Signed-off-by: Ilya Lesikov <ilya@lesikov.com>
  • Loading branch information
ilya-lesikov committed Jul 10, 2023
1 parent 4b4cf0b commit 753e129
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
4 changes: 2 additions & 2 deletions cmd/werf/converge/converge.go
Expand Up @@ -472,7 +472,7 @@ func run(ctx context.Context, containerBackend container_backend.ContainerBacken
}

var extraRuntimeResourceMutators []mutator.RuntimeResourceMutator
if util.GetBoolEnvironmentDefaultFalse("WERF_EXPERIMENTAL_DEPLOY_ENGINE") {
if util.GetBoolEnvironmentDefaultFalse(helm.FEATURE_TOGGLE_ENV_EXPERIMENTAL_DEPLOY_ENGINE) {
extraRuntimeResourceMutators = []mutator.RuntimeResourceMutator{
helm.NewExtraAnnotationsMutator(userExtraAnnotations),
helm.NewExtraLabelsMutator(userExtraLabels),
Expand All @@ -495,7 +495,7 @@ func run(ctx context.Context, containerBackend container_backend.ContainerBacken
return err
}

if util.GetBoolEnvironmentDefaultFalse("WERF_EXPERIMENTAL_DEPLOY_ENGINE") {
if util.GetBoolEnvironmentDefaultFalse(helm.FEATURE_TOGGLE_ENV_EXPERIMENTAL_DEPLOY_ENGINE) {
// FIXME(ilya-lesikov): implement rollback
autoRollback := common.NewBool(cmdData.AutoRollback)
if *autoRollback {
Expand Down
4 changes: 3 additions & 1 deletion pkg/deploy/helm/init.go
Expand Up @@ -28,6 +28,8 @@ import (
"github.com/werf/werf/pkg/util"
)

const FEATURE_TOGGLE_ENV_EXPERIMENTAL_DEPLOY_ENGINE = "WERF_EXPERIMENTAL_DEPLOY_ENGINE"

type InitActionConfigOptions struct {
StatusProgressPeriod time.Duration
HooksStatusProgressPeriod time.Duration
Expand Down Expand Up @@ -78,7 +80,7 @@ func InitActionConfig(ctx context.Context, kubeInitializer KubeInitializer, rele
actionConfig.RegistryClient = opts.RegistryClient
}

if util.GetBoolEnvironmentDefaultFalse("WERF_EXPERIMENTAL_DEPLOY_ENGINE") {
if util.GetBoolEnvironmentDefaultFalse(FEATURE_TOGGLE_ENV_EXPERIMENTAL_DEPLOY_ENGINE) {
deferredKubeClient := kubeclient.NewDeferredKubeClient(configGetter)

waiter := resourcewaiter.NewResourceWaiter(deferredKubeClient.Dynamic(), deferredKubeClient.Mapper())
Expand Down
6 changes: 6 additions & 0 deletions pkg/telemetry/telemetrywerfio.go
Expand Up @@ -16,6 +16,7 @@ import (
sdktrace "go.opentelemetry.io/otel/sdk/trace"
"go.opentelemetry.io/otel/trace"

"github.com/werf/werf/pkg/deploy/helm"
"github.com/werf/werf/pkg/util"
"github.com/werf/werf/pkg/werf"
)
Expand Down Expand Up @@ -146,6 +147,11 @@ func (t *TelemetryWerfIO) getAttributes() map[string]interface{} {
if val := os.Getenv("TRDL_USE_WERF_GROUP_CHANNEL"); val != "" {
attributes["groupChannel"] = val
}
if val := os.Getenv(helm.FEATURE_TOGGLE_ENV_EXPERIMENTAL_DEPLOY_ENGINE); val == "1" {
attributes["expDeployEngine"] = true
} else {
attributes["expDeployEngine"] = false
}

{
if isCI := util.GetBoolEnvironmentDefaultFalse("CI"); isCI {
Expand Down

0 comments on commit 753e129

Please sign in to comment.