Skip to content

fix: keep trafficDistribution inside the deployment.enabled guard - #290

Open
lbarrosby wants to merge 1 commit into
coredns:masterfrom
lbarrosby:service-traffic-distribution-guard
Open

lbarrosby wants to merge 1 commit into
coredns:masterfrom
lbarrosby:service-traffic-distribution-guard

Conversation

@lbarrosby

Copy link
Copy Markdown
Contributor

Why is this pull request needed and what does it do?

In templates/service.yaml the trafficDistribution block sits after the {{- end }} that closes the deployment.enabled check. With deployment.enabled: false (running only the autoscaler or HPA against an existing CoreDNS) and service.trafficDistribution set, the template renders a document that only contains trafficDistribution: PreferClose, which is not a Kubernetes object, so helm install fails. This moves the block inside the guard.

Tests: a new case in tests/service_test.yaml asserts that nothing is rendered with deployment.enabled: false. It fails on master (1 document) and passes with the fix. helm unittest --strict, helm lint and ct lint pass, and the rendered Service with the deployment enabled is unchanged.

Which issues (if any) are related?

None.

Checklist:

  • I have bumped the chart version according to versioning.
  • I have updated the chart changelog with all the changes that come with this pull request according to changelog.
  • Any new values are backwards compatible and/or have sensible default.
  • I have signed off all my commits as required by DCO.

Changes are automatically published when merged to main. They are not published on branches.

Note on DCO

If the DCO action in the integration test fails, one or more of your commits are not signed off. Please click on the Details link next to the DCO action for instructions on how to resolve this.

The trafficDistribution block sat after the {{- end }} of the
deployment.enabled check in the Service template. With
deployment.enabled=false (autoscaler or HPA only, targeting an existing
CoreDNS) and service.trafficDistribution set, the template rendered a
document with only trafficDistribution in it, which is not a valid
Kubernetes object and makes the install fail.

Signed-off-by: Lucas Barros <lucasbarros.kam@gmail.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant