diff --git a/packages/extra/external-dns/Makefile b/packages/extra/external-dns/Makefile index 8b8fbc2f9..e6d2e8da4 100644 --- a/packages/extra/external-dns/Makefile +++ b/packages/extra/external-dns/Makefile @@ -5,3 +5,6 @@ include ../../../hack/package.mk generate: cozyvalues-gen -v values.yaml -s values.schema.json -r README.md ../../../hack/update-crd.sh + +test: + helm unittest . diff --git a/packages/extra/external-dns/templates/external-dns.yaml b/packages/extra/external-dns/templates/external-dns.yaml index 29780d508..b863083ca 100644 --- a/packages/extra/external-dns/templates/external-dns.yaml +++ b/packages/extra/external-dns/templates/external-dns.yaml @@ -33,7 +33,6 @@ spec: name: {{ .Values.provider | quote }} sources: - ingress - - service {{- if .Values.gatewayAPI }} - gateway-httproute - gateway-tlsroute diff --git a/packages/extra/external-dns/tests/sources_test.yaml b/packages/extra/external-dns/tests/sources_test.yaml new file mode 100644 index 000000000..4d459eec6 --- /dev/null +++ b/packages/extra/external-dns/tests/sources_test.yaml @@ -0,0 +1,23 @@ +suite: external-dns rendered sources +templates: + - templates/external-dns.yaml + +set: + provider: inmemory + +tests: + # The default source must not start a Node informer: the namespaced Role + # cannot grant access to nodes. + - it: enables only the ingress source by default + asserts: + - equal: + path: spec.values.external-dns.sources + value: [ingress] + + - it: adds the Gateway API route sources when gatewayAPI is on + set: + gatewayAPI: true + asserts: + - equal: + path: spec.values.external-dns.sources + value: [ingress, gateway-httproute, gateway-tlsroute]