You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(preflight): Add VM Image kubernetes version check (#1172)
This check ensures images that have the standard NKP naming scheme have
the image with the same kubernetes version as the cluster version.
**How has this been tested?**
create a cluster using `nkp create cluster nutanix --dry-run` and tweak
the image kubernetes version to be different from cluster kubernetes
version.
```
$ cat cluster.yaml
apiVersion: cluster.x-k8s.io/v1beta1
kind: Cluster
metadata:
...
name: nkp-sid
namespace: default
spec:
...
topology:
...
variables:
- name: clusterConfig
value:
...
controlPlane:
nutanix:
machineDetails:
...
image:
name: nkp-rocky-9.5-release-1.31.4-20250214003015.qcow2
type: name
version: v1.32.3
workers:
machineDeployments:
- class: default-worker
...
name: md-0
variables:
overrides:
- name: workerConfig
value:
nutanix:
machineDetails:
...
image:
name: nkp-rocky-9.5-release-1.31.4-20250214003015.qcow2
type: name
```
create the cluster
```
$ k apply -f cluster.yaml -v4
The request is invalid:
* cluster.spec.topology.variables[.name=clusterConfig].value.nutanix.controlPlane.machineDetails: kubernetes version mismatch: cluster kubernetes version '1.32.3' does not match image kubernetes version '1.31.4' (from image name 'nkp-rocky-9.5-release-1.31.4-20250214003015.qcow2')
* cluster.spec.topology.workers.machineDeployments[.name=md-0].variables[.name=workerConfig].value.nutanix.machineDetails: kubernetes version mismatch: cluster kubernetes version '1.32.3' does not match image kubernetes version '1.31.4' (from image name 'nkp-rocky-9.5-release-1.31.4-20250214003015.qcow2')
```
---------
Co-authored-by: Daniel Lipovetsky <daniel.lipovetsky@nutanix.com>
0 commit comments