File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -326,6 +326,10 @@ data:
326326 expert :
327327 enabled : {{ .Values.forge.expert.enabled | default false }}
328328 {{- if .Values.forge.expert.enabled }}
329+ {{- if ((.Values.forge.expert).insights).enabled }}
330+ insights :
331+ enabled : {{ .Values.forge.expert.insights.enabled | default false }}
332+ {{- end }}
329333 service :
330334 token : <%= ENV['EXPERT_TOKEN'] %>
331335 url : {{ ((.Values.forge.expert).service).url }}
Original file line number Diff line number Diff line change @@ -274,4 +274,62 @@ tests:
274274 secretKeyRef :
275275 name : flowfuse-secrets
276276 key : token
277- optional : true
277+ optional : true
278+
279+ - it : should not include insights configuration when insights key is absent
280+ template : configmap.yaml
281+ set :
282+ forge.expert :
283+ enabled : true
284+ service :
285+ url : " https://expert.example.com"
286+ token : " test-token"
287+ asserts :
288+ - notMatchRegex :
289+ path : data["flowforge.yml"]
290+ pattern : " insights:"
291+
292+ - it : should not include insights configuration when insights.enabled is false
293+ template : configmap.yaml
294+ set :
295+ forge.expert :
296+ enabled : true
297+ service :
298+ url : " https://expert.example.com"
299+ token : " test-token"
300+ insights :
301+ enabled : false
302+ asserts :
303+ - notMatchRegex :
304+ path : data["flowforge.yml"]
305+ pattern : " insights:"
306+
307+ - it : should include insights configuration when expert and insights are both enabled
308+ template : configmap.yaml
309+ set :
310+ forge.expert :
311+ enabled : true
312+ service :
313+ url : " https://expert.example.com"
314+ token : " test-token"
315+ insights :
316+ enabled : true
317+ asserts :
318+ - matchRegex :
319+ path : data["flowforge.yml"]
320+ pattern : " insights:"
321+ - matchRegex :
322+ path : data["flowforge.yml"]
323+ pattern : " insights:\\ n\\ s+enabled: true"
324+
325+ - it : should not include insights configuration when expert is disabled
326+ template : configmap.yaml
327+ set :
328+ forge.expert :
329+ enabled : false
330+ insights :
331+ enabled : true
332+ asserts :
333+ - notMatchRegex :
334+ path : data["flowforge.yml"]
335+ pattern : " insights:"
You can’t perform that action at this time.
0 commit comments