Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions helm/flowfuse/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,10 @@ data:
expert:
enabled: {{ .Values.forge.expert.enabled | default false }}
{{- if .Values.forge.expert.enabled }}
{{- if ((.Values.forge.expert).insights).enabled }}
insights:
enabled: {{ .Values.forge.expert.insights.enabled | default false }}
{{- end }}
service:
token: <%= ENV['EXPERT_TOKEN'] %>
url: {{ ((.Values.forge.expert).service).url }}
Expand Down
60 changes: 59 additions & 1 deletion helm/flowfuse/tests/expert_feature_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -274,4 +274,62 @@ tests:
secretKeyRef:
name: flowfuse-secrets
key: token
optional: true
optional: true

- it: should not include insights configuration when insights key is absent
template: configmap.yaml
set:
forge.expert:
enabled: true
service:
url: "https://expert.example.com"
token: "test-token"
asserts:
- notMatchRegex:
path: data["flowforge.yml"]
pattern: "insights:"

- it: should not include insights configuration when insights.enabled is false
template: configmap.yaml
set:
forge.expert:
enabled: true
service:
url: "https://expert.example.com"
token: "test-token"
insights:
enabled: false
asserts:
- notMatchRegex:
path: data["flowforge.yml"]
pattern: "insights:"

- it: should include insights configuration when expert and insights are both enabled
template: configmap.yaml
set:
forge.expert:
enabled: true
service:
url: "https://expert.example.com"
token: "test-token"
insights:
enabled: true
asserts:
- matchRegex:
path: data["flowforge.yml"]
pattern: "insights:"
- matchRegex:
path: data["flowforge.yml"]
pattern: "insights:\\n\\s+enabled: true"

- it: should not include insights configuration when expert is disabled
template: configmap.yaml
set:
forge.expert:
enabled: false
insights:
enabled: true
asserts:
- notMatchRegex:
path: data["flowforge.yml"]
pattern: "insights:"
Loading