@@ -81,6 +81,12 @@ kind: GatewayClassBlueprint
8181metadata:
8282 name: default-gateway-class
8383spec:
84+ values:
85+ default:
86+ configmap2SuffixData:
87+ - one
88+ - two
89+ - three
8490 gatewayTemplate:
8591 status:
8692 template: |
@@ -109,14 +115,25 @@ spec:
109115 data:
110116 valueToRead1: Hello
111117 valueToRead2: World
112- configMapTestIntermediate : |
118+ configMapTestIntermediate1 : |
113119 apiVersion: v1
114120 kind: ConfigMap
115121 metadata:
116- name: intermediate -configmap
122+ name: intermediate1 -configmap
117123 namespace: {{ .Gateway.metadata.namespace }}
118124 data:
119125 valueIntermediate: {{ (index .Resources.configMapTestSource 0).data.valueToRead1 }}
126+ configMapTestIntermediate2: |
127+ {{ range .Values.configmap2SuffixData }}
128+ apiVersion: v1
129+ kind: ConfigMap
130+ metadata:
131+ name: intermediate2-configmap-{{ . }}
132+ namespace: {{ $.Gateway.metadata.namespace }}
133+ data:
134+ valueIntermediate: {{ (index $.Resources.configMapTestSource 0).data.valueToRead1 }}-{{ . }}
135+ ---
136+ {{ end }}
120137 # Use references to multiple resources coupled with template pipeline and functions
121138 configMapTestDestination: |
122139 apiVersion: v1
@@ -125,7 +142,8 @@ spec:
125142 name: dst-configmap
126143 namespace: {{ .Gateway.metadata.namespace }}
127144 data:
128- valueRead: {{ printf "%s, %s" (index .Resources.configMapTestIntermediate 0).data.valueIntermediate (index .Resources.configMapTestSource 0).data.valueToRead2 | upper }}
145+ valueRead: {{ printf "%s, %s" (index .Resources.configMapTestIntermediate1 0).data.valueIntermediate (index .Resources.configMapTestSource 0).data.valueToRead2 | upper }}
146+ valueRead2: {{ printf "Testing, one two %s" (index .Resources.configMapTestIntermediate2 2).data.valueIntermediate | upper }}
129147 httpRouteTemplate:
130148 resourceTemplates:
131149 shadowHttproute: |
@@ -270,6 +288,7 @@ var _ = Describe("Gateway controller", func() {
270288
271289 By ("Setting the content of the destination configmap" )
272290 Expect (cm .Data ["valueRead" ]).To (Equal ("HELLO, WORLD" ))
291+ Expect (cm .Data ["valueRead2" ]).To (Equal ("TESTING, ONE TWO HELLO-THREE" ))
273292 })
274293 })
275294})
0 commit comments