Skip to content

Show Kubernetes version from status not spec #849

@kvaps

Description

@kvaps

Hey, I just noticed that additionalPrinterColumns outputs the version requested (from spec.version) not the actual version of the cluster (from status.version):

# kubectl get kamajicontrolplane
NAME              VERSION   INITIALIZED   READY   AGE
kubernetes-test   1.32.4    true          true    100m
# kubectl get tcp
NAME              VERSION   STATUS   CONTROL-PLANE ENDPOINT   KUBECONFIG                         DATASTORE     AGE
kubernetes-test   v1.32.4   Ready    10.96.186.171:6443       kubernetes-test-admin-kubeconfig   tenant-root   89m

I might be wrong, but from my experience many operators report actual version by default:

k get controlplaneproviders.operator.cluster.x-k8s.io -A

From this I would ask to consider showing status.version instead of spec.version by default, or even show both VERSION and INSTALLEDVERSION, because sometimes it creates confusion when actual installed version is different and can't be updated for some reason.

Eg. for issue I mentoined here:
clastix/cluster-api-control-plane-provider-kamaji#225

I saw that version in output is already new, but actual version wasn't applied due to webhook

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions