Skip to content

Commit

Permalink
Change default value for disable wolfi env var (#2064)
Browse files Browse the repository at this point in the history
mrodm authored Sep 3, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent d7a0eb7 commit a4e1303
Showing 3 changed files with 6 additions and 7 deletions.
6 changes: 3 additions & 3 deletions internal/install/application_configuration.go
Original file line number Diff line number Diff line change
@@ -161,10 +161,10 @@ func selectElasticAgentImageName(version, agentBaseImage string) string {
return elasticAgentImageName
}

disableWolfiImages := false
disableWolfiImages := true
valueEnv, ok := os.LookupEnv(disableElasticAgentWolfiEnvVar)
if ok && strings.ToLower(valueEnv) != "false" {
disableWolfiImages = true
if ok && strings.ToLower(valueEnv) != "true" {
disableWolfiImages = false
}
switch {
case !disableWolfiImages && !v.LessThan(elasticAgentWolfiVersion) && agentBaseImage != "complete":
6 changes: 3 additions & 3 deletions internal/install/application_configuration_test.go
Original file line number Diff line number Diff line change
@@ -52,10 +52,10 @@ func TestSelectElasticAgentImageName_NextStackInOwnNamespace(t *testing.T) {
assert.Equal(t, selected, elasticAgentCompleteImageName)
}

func TestSelectElasticAgentImageName_WolfiImage(t *testing.T) {
func TestSelectElasticAgentImageName_DefaultImage816(t *testing.T) {
version := "8.16.0-SNAPSHOT"
selected := selectElasticAgentImageName(version, "")
assert.Equal(t, selected, elasticAgentWolfiImageName)
assert.Equal(t, selected, elasticAgentCompleteImageName)
}

func TestSelectElasticAgentImageName_DisableWolfiImageEnvVar(t *testing.T) {
@@ -79,5 +79,5 @@ func TestSelectCompleteElasticAgentImageName_ForceCompleteImage(t *testing.T) {
func TestSelectCompleteElasticAgentImageName_ForceDefaultImage(t *testing.T) {
version := "8.16.0-SNAPSHOT"
selected := selectElasticAgentImageName(version, "default")
assert.Equal(t, selected, elasticAgentWolfiImageName)
assert.Equal(t, selected, elasticAgentCompleteImageName)
}
1 change: 0 additions & 1 deletion internal/testrunner/runners/system/runner.go
Original file line number Diff line number Diff line change
@@ -378,7 +378,6 @@ func (r *runner) getAllVariants(folder testrunner.TestFolder) ([]string, error)
if len(variants) == 1 && variants[0] == "" {
logger.Debug("No variant mode")
}
logger.Debugf(">>>>>> number of variants loaded: %d - %q", len(variants), strings.Join(variants, ","))
}

return variants, nil

0 comments on commit a4e1303

Please sign in to comment.