mirror of
https://github.com/kubernetes-sigs/external-dns.git
synced 2025-08-06 17:46:57 +02:00
chore(helm): add validation for prefix and suffix and capture regression (#5250)
* chore(helm): add valiation.tpl and capture regression Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com> * chore(helm): add valiation.tpl and capture regression Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com> * chore(helm): add validation.tpl and capture regression Co-authored-by: Michel Loiseleur <97035654+mloiseleur@users.noreply.github.com> * chore(helm): add validation.tpl and capture regression Co-authored-by: Michel Loiseleur <97035654+mloiseleur@users.noreply.github.com> * chore(helm): add validation.tpl and capture regression Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com> * chore(helm): add validation.tpl and capture regression Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com> * chore(helm): add validation for prefix and suffix and capture regression Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com> * chore(helm): add validation for prefix and suffix and capture regression Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com> * chore(helm): add validation for prefix and suffix and capture regression Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com> * chore(helm): add validation for prefix and suffix and capture regression Co-authored-by: Steve Hipwell <steve.hipwell@gmail.com> --------- Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com> Co-authored-by: Michel Loiseleur <97035654+mloiseleur@users.noreply.github.com> Co-authored-by: Steve Hipwell <steve.hipwell@gmail.com>
This commit is contained in:
parent
cf9ab7be8b
commit
5eeef23b1d
@ -24,6 +24,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
### Fixed
|
||||
|
||||
- Correctly handles 'txtPrefix' and 'txtSuffix' arguments when both are provided. ([#5250](https://github.com/kubernetes-sigs/external-dns/pull/5250)) _@ivankatliarchuk_
|
||||
- Add missing types in the schema for empty values ([#5228](https://github.com/kubernetes-sigs/external-dns/pull/5228)) _@ivankatliarchuk_
|
||||
- Add missing types in the schema for empty values ([#5207](https://github.com/kubernetes-sigs/external-dns/pull/5207)) _@t3mi_
|
||||
|
||||
|
@ -100,10 +100,12 @@ spec:
|
||||
{{- if .Values.txtOwnerId }}
|
||||
- --txt-owner-id={{ .Values.txtOwnerId }}
|
||||
{{- end }}
|
||||
{{- if and .Values.txtPrefix .Values.txtSuffix }}
|
||||
{{- fail (printf "'txtPrefix' and 'txtSuffix' are mutually exclusive") }}
|
||||
{{- end }}
|
||||
{{- if .Values.txtPrefix }}
|
||||
- --txt-prefix={{ .Values.txtPrefix }}
|
||||
{{- end }}
|
||||
{{- if and (eq .Values.txtPrefix "") (ne .Values.txtSuffix "") }}
|
||||
{{- else if .Values.txtSuffix }}
|
||||
- --txt-suffix={{ .Values.txtSuffix }}
|
||||
{{- end }}
|
||||
{{- if .Values.namespaced }}
|
||||
|
@ -6,7 +6,6 @@ release:
|
||||
tests:
|
||||
- it: should provide expected default flags
|
||||
asserts:
|
||||
# - matchSnapshot: {}
|
||||
- exists :
|
||||
path: spec.template.spec.containers[?(@.name == "external-dns")]
|
||||
- equal :
|
||||
@ -21,33 +20,6 @@ tests:
|
||||
- --registry=txt
|
||||
- --provider=aws
|
||||
|
||||
- it: should configure txtPrefix and ignore txtSuffix if not empty
|
||||
set:
|
||||
provider:
|
||||
name: cloudflare
|
||||
txtPrefix: "test-prefix"
|
||||
txtSuffix: "test-suffix"
|
||||
txtOwnerId: "testing"
|
||||
asserts:
|
||||
- exists :
|
||||
path: spec.template.spec.containers[?(@.name == "external-dns")]
|
||||
- equal :
|
||||
path: spec.template.spec.containers[?(@.name == "external-dns")].args
|
||||
value:
|
||||
- --log-level=info
|
||||
- --log-format=text
|
||||
- --interval=1m
|
||||
- --source=service
|
||||
- --source=ingress
|
||||
- --policy=upsert-only
|
||||
- --registry=txt
|
||||
- --txt-owner-id=testing
|
||||
- --txt-prefix=test-prefix
|
||||
- --provider=cloudflare
|
||||
- notContains:
|
||||
path: spec.template.spec.containers[?(@.name == "external-dns")].args
|
||||
content: "--txt-suffix=test-suffix"
|
||||
|
||||
- it: should configure 'txtSuffix' when not empty with 'txtPrefix' empty
|
||||
set:
|
||||
txtPrefix: ""
|
||||
@ -70,6 +42,19 @@ tests:
|
||||
- notContains:
|
||||
path: spec.template.spec.containers[?(@.name == "external-dns")].args
|
||||
content: "--txt-prefix=test-prefix"
|
||||
- contains:
|
||||
path: spec.template.spec.containers[?(@.name == "external-dns")].args
|
||||
content: "--txt-suffix=test-suffix"
|
||||
|
||||
- it: should configure 'txtSuffix' when set and 'txtPrefix' is not present
|
||||
set:
|
||||
txtSuffix: "custom-suffix"
|
||||
asserts:
|
||||
- exists :
|
||||
path: spec.template.spec.containers[?(@.name == "external-dns")]
|
||||
- contains:
|
||||
path: spec.template.spec.containers[?(@.name == "external-dns")].args
|
||||
content: "--txt-suffix=custom-suffix"
|
||||
|
||||
- it: should be able configure multiple sources
|
||||
set:
|
||||
@ -117,3 +102,11 @@ tests:
|
||||
- --zone-id-filter=/hostedzone/Z00003
|
||||
- --zone-id-filter=/hostedzone/Z00004
|
||||
- --zone-id-filter=/hostedzone/Z00005
|
||||
|
||||
- it: should throw error when txtPrefix and txtSuffix are set
|
||||
set:
|
||||
txtPrefix: "test-prefix"
|
||||
txtSuffix: "test-suffix"
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorMessage: "'txtPrefix' and 'txtSuffix' are mutually exclusive"
|
||||
|
Loading…
Reference in New Issue
Block a user