Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix activegate.customproperties.value when multi line string is used #691

Merged
merged 6 commits into from
Apr 6, 2022
Merged
Show file tree
Hide file tree
Changes from 5 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
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,11 @@ spec:
{{- end }}

{{- if .Values.activeGate.customProperties }}
{{- if .Values.activeGate.customProperties.value }}
customProperties:
value: {{ .Values.activeGate.customProperties.value }}
{{- else if .Values.activeGate.customProperties.valueFrom }}
customProperties:
{{- if (.Values.activeGate.customProperties).value }}
chrismuellner marked this conversation as resolved.
Show resolved Hide resolved
value: |
{{ (.Values.activeGate.customProperties).value | indent 8 }}
{{- else if (.Values.activeGate.customProperties).valueFrom }}
valueFrom: {{ .Values.activeGate.customProperties.valueFrom }}
{{- end }}
{{- end }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,53 @@ tests:
path: spec.activeGate.customProperties.valueFrom
- equal:
path: spec.activeGate.customProperties.value
value: |
test-value

- it: "should add routing customProperties multi-line value if set and enabled"
set:
apiUrl: test-api-url
apiToken: test-api-token
paasToken: test-paas-token
activeGate:
capabilities:
- kubernetes-monitoring
- routing
- metrics-ingest
customProperties:
value: |
[test-value]
key=value
asserts:
- isNotNull:
path: spec.activeGate.customProperties
- isNull:
path: spec.activeGate.customProperties.valueFrom
- equal:
path: spec.activeGate.customProperties.value
value: |
[test-value]
key=value

- it: "should add routing customProperties valueFrom if set and enabled"
set:
apiUrl: test-api-url
apiToken: test-api-token
paasToken: test-paas-token
activeGate:
capabilities:
- kubernetes-monitoring
- routing
- metrics-ingest
customProperties:
valueFrom: test-value
asserts:
- isNotNull:
path: spec.activeGate.customProperties
- isNull:
path: spec.activeGate.customProperties.value
- equal:
path: spec.activeGate.customProperties.valueFrom
value: test-value

- it: "should add routing customProperties valueFrom if set and enabled"
Expand Down Expand Up @@ -138,7 +185,8 @@ tests:
path: spec.activeGate.customProperties.valueFrom
- equal:
path: spec.activeGate.customProperties.value
value: test-value
value: |
test-value

- it: "should add routing resource if set and enabled"
set:
Expand Down