Skip to content

Commit

Permalink
CRO template fix + enhancements
Browse files Browse the repository at this point in the history
  • Loading branch information
anirudhprasad-sap committed Aug 14, 2024
1 parent 15c05f6 commit 2b12d87
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
5 changes: 3 additions & 2 deletions files/chartFlexibleTemplates/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@
{{ printf "%s" $xsuaa.parameters.xsappname }}
{{- end -}}

{{- define "hasServiceOfferingName" -}}
{{- define "hasService" -}}
{{- $found := "false" -}}
{{- $offeringName := .offeringName -}}
{{- $planName := .planName -}}
{{- $si := .si -}}
{{- range $sik, $siv := $si}}
{{- if (eq (get $siv "serviceOfferingName") $offeringName) -}}
{{- if and (eq (get $siv "serviceOfferingName") $offeringName) (eq (get $siv "servicePlanName") $planName) -}}
{{- $found = "true" -}}
{{- end -}}
{{- end -}}
Expand Down
19 changes: 14 additions & 5 deletions files/chartFlexibleTemplates/templates/cap-operator-cros.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ spec:
{{- end }}
{{- end }}
istioIngressGatewayLabels:
{{- range $k, $v := .Values.ingressGatewayLabels }}
{{- range $k, $v := .Values.app.istioIngressGatewayLabels }}
- name: {{ $k }}
value: {{ $v | default "invalidValue"}}
{{ end }}
Expand Down Expand Up @@ -79,12 +79,15 @@ spec:
consumedBTPServices:
- {{ include "originalAppName" $ }}-uaa-bind
- {{ include "originalAppName" $ }}-saas-registry-bind
{{- if eq (include "hasServiceOfferingName" (dict "si" .Values.serviceInstances "offeringName" "destination")) "true" }}
{{- if eq (include "hasService" (dict "si" .Values.serviceInstances "offeringName" "destination" "planName" "lite")) "true" }}
- {{ include "originalAppName" $ }}-destination-bind
{{- end}}
{{- if eq (include "hasServiceOfferingName" (dict "si" .Values.serviceInstances "offeringName" "html5-apps-repo")) "true" }}
{{- if eq (include "hasService" (dict "si" .Values.serviceInstances "offeringName" "html5-apps-repo" "planName" "app-runtime")) "true" }}
- {{ include "originalAppName" $ }}-html5-repo-runtime-bind
{{- end }}
{{- if eq (include "hasService" (dict "si" .Values.serviceInstances "offeringName" "portal" "planName" "standard")) "true" }}
- {{ include "originalAppName" $ }}-portal-bind
{{- end }}
deploymentDefinition:
type: Router
image: {{ .Values.workloads.appRouter.image }}
Expand Down Expand Up @@ -115,8 +118,14 @@ spec:
consumedBTPServices:
- {{ include "originalAppName" $ }}-uaa-bind
- {{ include "originalAppName" $ }}-saas-registry-bind
{{- if eq (include "hasServiceOfferingName" (dict "si" .Values.serviceInstances "offeringName" "html5-apps-repo")) "true" }}
- {{ include "originalAppName" $ }}-html5-repo-runtime-bind
{{- if eq (include "hasService" (dict "si" .Values.serviceInstances "offeringName" "html5-apps-repo" "planName" "app-host")) "true" }}
- {{ include "originalAppName" $ }}-html5-repo-host-bind
{{- end }}
{{- if eq (include "hasService" (dict "si" .Values.serviceInstances "offeringName" "portal" "planName" "standard")) "true" }}
- {{ include "originalAppName" $ }}-portal-bind
{{- end }}
{{- if eq (include "hasService" (dict "si" .Values.serviceInstances "offeringName" "content-agent" "planName" "application")) "true" }}
- {{ include "originalAppName" $ }}-content-agent-bind
{{- end }}
jobDefinition:
type: Content
Expand Down

0 comments on commit 2b12d87

Please sign in to comment.