diff --git a/files/chart/templates/_helpers.tpl b/files/chart/templates/_helpers.tpl index 0c4aa77..aea219c 100644 --- a/files/chart/templates/_helpers.tpl +++ b/files/chart/templates/_helpers.tpl @@ -3,6 +3,6 @@ {{- end -}} {{- define "appName" -}} -{{- $saasRegistry := index .Values.serviceInstances "saas-registry" -}} -{{ printf "%s" $saasRegistry.parameters.appName }} +{{- $xsuaa := index .Values.serviceInstances "xsuaa" -}} +{{ printf "%s" $xsuaa.parameters.xsappname }} {{- end -}} diff --git a/files/chart/templates/cap-operator-cros.yaml b/files/chart/templates/cap-operator-cros.yaml index 3f4c72a..b38dffb 100644 --- a/files/chart/templates/cap-operator-cros.yaml +++ b/files/chart/templates/cap-operator-cros.yaml @@ -74,99 +74,11 @@ spec: {{- end }} {{- if $v.deploymentDefinition }} - deploymentDefinition: - - {{- if $v.deploymentDefinition.type }} - type: {{ $v.deploymentDefinition.type }} - {{- end }} - - {{- if $v.deploymentDefinition.image }} - image: {{ $v.deploymentDefinition.image }} - {{- end }} - - {{- if $v.deploymentDefinition.imagePullPolicy }} - imagePullPolicy: {{ $v.deploymentDefinition.imagePullPolicy }} - {{- end }} - - {{- if $v.deploymentDefinition.command }} - command: {{- toYaml $v.deploymentDefinition.command | trim | nindent 6 }} - {{- end }} - - {{- if $v.deploymentDefinition.env }} - env: {{- toYaml $v.deploymentDefinition.env | trim | nindent 6 }} - {{- end }} - - {{- if $v.deploymentDefinition.resources }} - resources: {{- toYaml $v.deploymentDefinition.resources | trim | nindent 8 }} - {{- end }} - - {{- if $v.deploymentDefinition.securityContext }} - securityContext: {{- toYaml $v.deploymentDefinition.securityContext | trim | nindent 8 }} - {{- end }} - - {{- if $v.deploymentDefinition.podSecurityContext }} - podSecurityContext: {{- toYaml $v.deploymentDefinition.podSecurityContext | trim | nindent 8 }} - {{- end }} - - {{- if $v.deploymentDefinition.replicas }} - replicas: {{ $v.deploymentDefinition.replicas }} - {{- end }} - - {{- if $v.deploymentDefinition.ports }} - ports: {{- toYaml $v.deploymentDefinition.ports | trim | nindent 6 }} - {{- end }} - - {{- if $v.deploymentDefinition.livenessProbe }} - livenessProbe: {{- toYaml $v.deploymentDefinition.livenessProbe | trim | nindent 8 }} - {{- end }} - - {{- if $v.deploymentDefinition.readinessProbe }} - readinessProbe: {{- toYaml $v.deploymentDefinition.readinessProbe | trim | nindent 8 }} - {{- end }} + deploymentDefinition: {{- toYaml $v.deploymentDefinition | trim | nindent 6 }} {{- end }} {{- if $v.jobDefinition }} - jobDefinition: - - {{- if $v.jobDefinition.type }} - type: {{ $v.jobDefinition.type }} - {{- end }} - - {{- if $v.jobDefinition.image }} - image: {{ $v.jobDefinition.image }} - {{- end }} - - {{- if $v.jobDefinition.imagePullPolicy }} - imagePullPolicy: {{ $v.jobDefinition.imagePullPolicy }} - {{- end }} - - {{- if $v.jobDefinition.command }} - command: {{- toYaml $v.jobDefinition.command | trim | nindent 6 }} - {{- end }} - - {{- if $v.jobDefinition.env }} - env: {{- toYaml $v.jobDefinition.env | trim | nindent 6 }} - {{- end }} - - {{- if $v.jobDefinition.resources }} - resources: {{- toYaml $v.jobDefinition.resources | trim | nindent 8 }} - {{- end }} - - {{- if $v.jobDefinition.securityContext }} - securityContext: {{- toYaml $v.jobDefinition.securityContext | trim | nindent 8 }} - {{- end }} - - {{- if $v.jobDefinition.podSecurityContext }} - podSecurityContext: {{- toYaml $v.jobDefinition.podSecurityContext | trim | nindent 8 }} - {{- end }} - - {{- if $v.jobDefinition.backoffLimit }} - backoffLimit: {{ $v.jobDefinition.backoffLimit }} - {{- end }} - - {{- if $v.jobDefinition.ttlSecondsAfterFinished }} - ttlSecondsAfterFinished: {{ $v.jobDefinition.ttlSecondsAfterFinished }} - {{- end }} + jobDefinition: {{- toYaml $v.jobDefinition | trim | nindent 6 }} {{- end }} {{- end }} diff --git a/test/files/expectedChart/templates/_helpers.tpl b/test/files/expectedChart/templates/_helpers.tpl index 0c4aa77..aea219c 100644 --- a/test/files/expectedChart/templates/_helpers.tpl +++ b/test/files/expectedChart/templates/_helpers.tpl @@ -3,6 +3,6 @@ {{- end -}} {{- define "appName" -}} -{{- $saasRegistry := index .Values.serviceInstances "saas-registry" -}} -{{ printf "%s" $saasRegistry.parameters.appName }} +{{- $xsuaa := index .Values.serviceInstances "xsuaa" -}} +{{ printf "%s" $xsuaa.parameters.xsappname }} {{- end -}} diff --git a/test/files/expectedChart/templates/cap-operator-cros.yaml b/test/files/expectedChart/templates/cap-operator-cros.yaml index 3f4c72a..b38dffb 100644 --- a/test/files/expectedChart/templates/cap-operator-cros.yaml +++ b/test/files/expectedChart/templates/cap-operator-cros.yaml @@ -74,99 +74,11 @@ spec: {{- end }} {{- if $v.deploymentDefinition }} - deploymentDefinition: - - {{- if $v.deploymentDefinition.type }} - type: {{ $v.deploymentDefinition.type }} - {{- end }} - - {{- if $v.deploymentDefinition.image }} - image: {{ $v.deploymentDefinition.image }} - {{- end }} - - {{- if $v.deploymentDefinition.imagePullPolicy }} - imagePullPolicy: {{ $v.deploymentDefinition.imagePullPolicy }} - {{- end }} - - {{- if $v.deploymentDefinition.command }} - command: {{- toYaml $v.deploymentDefinition.command | trim | nindent 6 }} - {{- end }} - - {{- if $v.deploymentDefinition.env }} - env: {{- toYaml $v.deploymentDefinition.env | trim | nindent 6 }} - {{- end }} - - {{- if $v.deploymentDefinition.resources }} - resources: {{- toYaml $v.deploymentDefinition.resources | trim | nindent 8 }} - {{- end }} - - {{- if $v.deploymentDefinition.securityContext }} - securityContext: {{- toYaml $v.deploymentDefinition.securityContext | trim | nindent 8 }} - {{- end }} - - {{- if $v.deploymentDefinition.podSecurityContext }} - podSecurityContext: {{- toYaml $v.deploymentDefinition.podSecurityContext | trim | nindent 8 }} - {{- end }} - - {{- if $v.deploymentDefinition.replicas }} - replicas: {{ $v.deploymentDefinition.replicas }} - {{- end }} - - {{- if $v.deploymentDefinition.ports }} - ports: {{- toYaml $v.deploymentDefinition.ports | trim | nindent 6 }} - {{- end }} - - {{- if $v.deploymentDefinition.livenessProbe }} - livenessProbe: {{- toYaml $v.deploymentDefinition.livenessProbe | trim | nindent 8 }} - {{- end }} - - {{- if $v.deploymentDefinition.readinessProbe }} - readinessProbe: {{- toYaml $v.deploymentDefinition.readinessProbe | trim | nindent 8 }} - {{- end }} + deploymentDefinition: {{- toYaml $v.deploymentDefinition | trim | nindent 6 }} {{- end }} {{- if $v.jobDefinition }} - jobDefinition: - - {{- if $v.jobDefinition.type }} - type: {{ $v.jobDefinition.type }} - {{- end }} - - {{- if $v.jobDefinition.image }} - image: {{ $v.jobDefinition.image }} - {{- end }} - - {{- if $v.jobDefinition.imagePullPolicy }} - imagePullPolicy: {{ $v.jobDefinition.imagePullPolicy }} - {{- end }} - - {{- if $v.jobDefinition.command }} - command: {{- toYaml $v.jobDefinition.command | trim | nindent 6 }} - {{- end }} - - {{- if $v.jobDefinition.env }} - env: {{- toYaml $v.jobDefinition.env | trim | nindent 6 }} - {{- end }} - - {{- if $v.jobDefinition.resources }} - resources: {{- toYaml $v.jobDefinition.resources | trim | nindent 8 }} - {{- end }} - - {{- if $v.jobDefinition.securityContext }} - securityContext: {{- toYaml $v.jobDefinition.securityContext | trim | nindent 8 }} - {{- end }} - - {{- if $v.jobDefinition.podSecurityContext }} - podSecurityContext: {{- toYaml $v.jobDefinition.podSecurityContext | trim | nindent 8 }} - {{- end }} - - {{- if $v.jobDefinition.backoffLimit }} - backoffLimit: {{ $v.jobDefinition.backoffLimit }} - {{- end }} - - {{- if $v.jobDefinition.ttlSecondsAfterFinished }} - ttlSecondsAfterFinished: {{ $v.jobDefinition.ttlSecondsAfterFinished }} - {{- end }} + jobDefinition: {{- toYaml $v.jobDefinition | trim | nindent 6 }} {{- end }} {{- end }}