Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion controllers/cloud.redhat.com/providers/iqe/impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ func joinNullableSlice(s *[]string) string {

func updateEnvVars(existingEnvVars []core.EnvVar, newEnvVars []core.EnvVar) []core.EnvVar {
for _, newEnvVar := range newEnvVars {
if newEnvVar.Value == "" {
// do not update value of an env var if the new value is empty
continue
}
replaced := false
for idx, existingEnvVar := range existingEnvVars {
if existingEnvVar.Name == newEnvVar.Name {
Expand All @@ -56,12 +60,13 @@ func updateEnvVars(existingEnvVars []core.EnvVar, newEnvVars []core.EnvVar) []co
}

func createIqeContainer(j *batchv1.Job, nn types.NamespacedName, cji *crd.ClowdJobInvocation, env *crd.ClowdEnvironment, app *crd.ClowdApp) *core.Container {
// create env vars
// iqePlugins comes from ClowdApp spec unless overridden
iqePlugins := app.Spec.Testing.IqePlugin
if cji.Spec.Testing.Iqe.IqePlugins != "" {
iqePlugins = cji.Spec.Testing.Iqe.IqePlugins
}

// default log level is "info" unless overridden
logLevel := cji.Spec.Testing.Iqe.LogLevel
if cji.Spec.Testing.Iqe.LogLevel == "" {
logLevel = "info"
Expand Down
2 changes: 1 addition & 1 deletion tests/kuttl/test-iqe-jobs/01-assert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ spec:
- name: ACG_CONFIG
value: /cdapp/cdappconfig.json
- name: IQE_PLUGINS
value: "some,different,plugins"
value: "host-inventory"
- name: IQE_MARKER_EXPRESSION
value: "smoke"
- name: IQE_FILTER_EXPRESSION
Expand Down
4 changes: 3 additions & 1 deletion tests/kuttl/test-iqe-jobs/01-pods.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,15 @@ spec:
testing:
iqe:
imageTag: latest
plugins: "some,different,plugins"
env:
- name: SOME_ENV_VAR
value: some_value
# test env var override behavior using IQE_LOG_LEVEL
- name: IQE_LOG_LEVEL
value: warning
# ensure that this does not override plugin defined on the ClowdApp
- name: IQE_PLUGINS
value: ""
ui:
enabled: false
marker: "smoke"
Expand Down