mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2025-12-14 05:45:06 +03:00
Check separately for 'v'-prefixed versions for ones which are derived (#12057)
The versions which are by default derived from `kube_version` can break the assert if kube_version start with `v`, because they use the start of `kube_version` as dict key. By putting them in their own assert, the first assert should trigger on `kube_version`, with a more explicit error.
This commit is contained in:
@@ -22,7 +22,6 @@
|
||||
- not cinder_csi_plugin_version.startswith('v')
|
||||
- not cni_version.startswith('v')
|
||||
- not dnsautoscaler_version.startswith('v')
|
||||
- not etcd_version.startswith('v')
|
||||
- not flannel_cni_version.startswith('v')
|
||||
- not flannel_version.startswith('v')
|
||||
- gateway_api_version is not defined or not gateway_api_version.startswith('v')
|
||||
@@ -38,12 +37,23 @@
|
||||
- not metrics_server_version.startswith('v')
|
||||
- not multus_version.startswith('v')
|
||||
- not netcheck_version.startswith('v')
|
||||
- not pod_infra_version.startswith('v')
|
||||
- not rbd_provisioner_version.startswith('v')
|
||||
- not runc_version.startswith('v')
|
||||
- not skopeo_version.startswith('v')
|
||||
- not yq_version.startswith('v')
|
||||
|
||||
- name: Stop if some derived versions have a 'v' left at the start
|
||||
# TODO: drop this task after 2.28.0 is released
|
||||
# The 'not defined' tests are exception for applications which version in not defined
|
||||
# in kubespray-defaults, only in their own roles.
|
||||
assert:
|
||||
msg: |
|
||||
All version string used in kubespray have been normalized to not use a leading 'v'.
|
||||
This check will be dropped in the next minor release.
|
||||
that:
|
||||
- not etcd_version.startswith('v')
|
||||
- not pod_infra_version.startswith('v')
|
||||
|
||||
- name: Stop if any host not in '--limit' does not have a fact cache
|
||||
vars:
|
||||
uncached_hosts: "{{ hostvars | dict2items | selectattr('value.ansible_default_ipv6', 'undefined') | selectattr('value.ansible_default_ipv4', 'undefined') | map(attribute='key') }}"
|
||||
|
||||
Reference in New Issue
Block a user