Skip to content

Commit

Permalink
fix: change code
Browse files Browse the repository at this point in the history
Signed-off-by: Ranjith M P <[email protected]>
  • Loading branch information
r1jt authored Oct 16, 2024
1 parent 3d38fd0 commit b36fe28
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions common/e2e_config/e2e_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,7 @@ func GetConfig() E2EConfig {
if err != nil {
panic(fmt.Sprintf("%v", err))
}
updateDisableLocalEngine()
}

// MayastorRootDir is either set from the environment variable
Expand Down Expand Up @@ -649,6 +650,29 @@ func saveConfig() {
}
}

func updateDisableLocalEngine() {
e2eDisableLocalEngines := os.Getenv("e2e_disable_local_engines")
if e2eDisableLocalEngines != "" {
engines := strings.Split(e2eDisableLocalEngines, ",")
e2eConfig.Product.DisableLocalEngines = appendUnique(e2eConfig.Product.DisableLocalEngines, engines)
}
saveConfig()
}

func appendUnique(slice []string, elements []string) []string {
existing := make(map[string]bool)
for _, el := range slice {
existing[el] = true
}
for _, el := range elements {
if !existing[el] {
slice = append(slice, el)
existing[el] = true
}
}
return slice
}

// SetControlPlane sets the control plane configuration if it is unset (i.e. empty) and writes it out if changed.
// If config setting matches the existing value no action.
// Returns true it the config control plane value matches the input value
Expand Down

0 comments on commit b36fe28

Please sign in to comment.