Skip to content

🐛 helm: preserve whitespace in metrics template values#1039

Merged
kubernetes-prow[bot] merged 2 commits into
kubernetes-sigs:mainfrom
spnngl:fix/helm/whitespaces
Jul 17, 2026
Merged

🐛 helm: preserve whitespace in metrics template values#1039
kubernetes-prow[bot] merged 2 commits into
kubernetes-sigs:mainfrom
spnngl:fix/helm/whitespaces

Conversation

@spnngl

@spnngl spnngl commented Apr 13, 2026

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:
The metrics field templates used {{- which strips leading whitespace, causing invalid YAML output like 'diagnosticsAddress:localhost:8443' instead of 'diagnosticsAddress: localhost:8443'.

This resulted in admission webhook rejections with error: 'cannot unmarshal string into Go struct field ManagerSpec.spec.manager.metrics of type v1alpha2.ControllerMetrics'

Remove the dash from {{- to {{ for insecureDiagnostics and diagnosticsAddress fields across all provider templates.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #1038

@netlify

netlify Bot commented Apr 13, 2026

Copy link
Copy Markdown

Deploy Preview for kubernetes-sigs-cluster-api-operator ready!

Name Link
🔨 Latest commit fb78d48
🔍 Latest deploy log https://app.netlify.com/projects/kubernetes-sigs-cluster-api-operator/deploys/6a5a0d6f98367a00089a0af9
😎 Deploy Preview https://deploy-preview-1039--kubernetes-sigs-cluster-api-operator.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Apr 13, 2026
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign furkatgofurov7 for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot

Copy link
Copy Markdown
Contributor

Welcome @spnngl!

It looks like this is your first PR to kubernetes-sigs/cluster-api-operator 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/cluster-api-operator has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Apr 13, 2026
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

Hi @spnngl. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Apr 13, 2026
@alexander-demicev

Copy link
Copy Markdown
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels May 11, 2026
@furkatgofurov7

Copy link
Copy Markdown
Member

Hi,

This needs a rebase on top of main HEAD to fix govuln CI failure

@furkatgofurov7

Copy link
Copy Markdown
Member

We are planning to cut a new operator release and include this fix in the release.
@spnngl can you please rebase this PR so we can go ahead with merging?

spnngl added 2 commits July 17, 2026 13:06
The metrics field templates used {{- which strips leading whitespace,
causing invalid YAML output like 'diagnosticsAddress:localhost:8443'
instead of 'diagnosticsAddress: localhost:8443'.

This resulted in admission webhook rejections with error:
'cannot unmarshal string into Go struct field ManagerSpec.spec.manager.metrics
of type v1alpha2.ControllerMetrics'

Remove the dash from {{- to {{ for insecureDiagnostics and
diagnosticsAddress fields across all provider templates.
@Autherain
Autherain force-pushed the fix/helm/whitespaces branch from 7fdc931 to fb78d48 Compare July 17, 2026 11:09

@Danil-Grigorev Danil-Grigorev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@kubernetes-prow kubernetes-prow Bot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 17, 2026
@kubernetes-prow

Copy link
Copy Markdown
Contributor

LGTM label has been added.

DetailsGit tree hash: dd3205bb622b70e1675fbafedd73bf49f92ff16f

@furkatgofurov7 furkatgofurov7 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you

/approve

@kubernetes-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: furkatgofurov7

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubernetes-prow kubernetes-prow Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 17, 2026
@kubernetes-prow
kubernetes-prow Bot merged commit fea1de1 into kubernetes-sigs:main Jul 17, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Helm: wrong templating on metrics

5 participants