Skip to content

Helm: wrong templating on metrics #1038

Description

@spnngl

What steps did you take and what happened:
Use this values with chart 0.26.0

bootstrap:
  kubeadm:
    version: "v1.12.5"
    manager:
      metrics:
        diagnosticsAddress: "localhost:8443"

Got this error

STDERR:
  Error: UPGRADE FAILED: post-upgrade hooks failed: warning: Hook post-upgrade cluster-api-operator/templates/infra.yaml failed: 1 error occurred:
  	* admission webhook "vinfrastructureprovider.kb.io" denied the request: json: cannot unmarshal string into Go struct field ManagerSpec.spec.manager.metrics of type v1alpha2.ControllerMetrics

COMBINED OUTPUT:
  Error: UPGRADE FAILED: post-upgrade hooks failed: warning: Hook post-upgrade cluster-api-operator/templates/infra.yaml failed: 1 error occurred:
  	* admission webhook "vinfrastructureprovider.kb.io" denied the request: json: cannot unmarshal string into Go struct field ManagerSpec.spec.manager.metrics of type v1alpha2.ControllerMetrics

Here what the templating is generating: diagnosticsAddress:localhost:8443

What did you expect to happen:

Install successful with metrics enabled at localhost:8443

Anything else you would like to add:
[Miscellaneous information that will assist in solving the issue.]

Environment:

  • Cluster-api-operator version: 0.26.0
  • Cluster-api version: 1.12.5
  • Minikube/KIND version: /
  • Kubernetes version: (use kubectl version): 1.34.3
  • OS (e.g. from /etc/os-release): ubuntu 24.04

/kind bug
[One or more /area label. See https://github.com/kubernetes-sigs/cluster-api-operator/labels?q=area for the list of labels]

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.lifecycle/staleDenotes an issue or PR has remained open with no activity and has become stale.needs-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions