Skip to content

Commit

Permalink
Allow injection of arbitrary properties into setupDatabase.properties…
Browse files Browse the repository at this point in the history
… via ADVANCED_SETTINGS (#351)
  • Loading branch information
RyanStan authored Oct 18, 2021
1 parent 1909c80 commit c36c4fe
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,7 @@ bypass.load.engine.classes={{ .Env.BYPASS_LOAD_ENGINE_CLASSES }}
bypass.load.assembled.classes={{ .Env.BYPASS_LOAD_ASSEMBLED_CLASSES }}
{{- end }}

#Enable adminstrator user after upgrade by default.
upgrade.enable.admin=true
# Enable adminstrator user after upgrade by default.
upgrade.enable.admin=true

{{ .Env.ADVANCED_SETTINGS }}
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,10 @@ data:
# Bypass loading assembly classes into database during installation
BYPASS_LOAD_ASSEMBLED_CLASSES: {{ .Values.bypassLoadAssembledClasses | quote }}
{{- end }}
{{- if .Values.advancedSettings }}
ADVANCED_SETTINGS: |-
{{- range .Values.advancedSettings }}
{{ .name }}={{ .value }}
{{- end }}
{{ end }}
{{ end }}
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,10 @@ data:
# Bypass loading assembly classes into database during installation
BYPASS_LOAD_ASSEMBLED_CLASSES: {{ .Values.bypassLoadAssembledClasses | quote }}
{{- end }}
{{- if .Values.advancedSettings }}
ADVANCED_SETTINGS: |-
{{- range .Values.advancedSettings }}
{{ .name }}={{ .value }}
{{- end }}
{{ end }}
{{ end }}
6 changes: 4 additions & 2 deletions terratest/src/test/pega/data/expectedSetupdatabase.properties
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,7 @@ bypass.load.engine.classes={{ .Env.BYPASS_LOAD_ENGINE_CLASSES }}
bypass.load.assembled.classes={{ .Env.BYPASS_LOAD_ASSEMBLED_CLASSES }}
{{- end }}

#Enable adminstrator user after upgrade by default.
upgrade.enable.admin=true
# Enable adminstrator user after upgrade by default.
upgrade.enable.admin=true

{{ .Env.ADVANCED_SETTINGS }}
19 changes: 10 additions & 9 deletions terratest/src/test/pega/utilities.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (
var volumeDefaultMode int32 = 420
var volumeDefaultModePtr = &volumeDefaultMode


// compareConfigMapData - Compares the config map deployed for each kind of tier with the excepted xml's
func compareConfigMapData(t *testing.T, actualFileData string, expectedFileName string) {
expectedFile, err := ioutil.ReadFile(expectedFileName)
Expand All @@ -25,6 +24,9 @@ func compareConfigMapData(t *testing.T, actualFileData string, expectedFileName
equal := false
if expectedFileData == actualFileData {
equal = true
} else {
println("Expected yaml contents:\n" + expectedFileData)
println("Actual yaml contents:\n" + actualFileData)
}
require.Equal(t, true, equal)
}
Expand All @@ -43,7 +45,7 @@ func aksSpecificUpgraderDeployEnvs(t *testing.T, options *helm.Options, containe

// VerifyInitContinerData - Verifies any possible initContainer that can occur in pega helm chart deployments
func VerifyInitContinerData(t *testing.T, containers []k8score.Container, options *helm.Options) {
var depName = getDeploymentName(options)
var depName = getDeploymentName(options)

if len(containers) == 0 {
println("no init containers")
Expand Down Expand Up @@ -83,15 +85,14 @@ func VerifyInitContinerData(t *testing.T, containers []k8score.Container, option
}
}


func getDeploymentName(options *helm.Options) string {
var depName string = options.SetValues["global.deployment.name"]
if (depName == "") {
depName = "pega"
}
return depName
var depName string = options.SetValues["global.deployment.name"]
if depName == "" {
depName = "pega"
}
return depName
}

func getObjName(options *helm.Options, suffix string) string {
return getDeploymentName(options) + suffix
return getDeploymentName(options) + suffix
}

0 comments on commit c36c4fe

Please sign in to comment.