Skip to content

Commit 17d7c50

Browse files
Backport: fix(module): fix Kubernetes version detection in templates (#990)
fix(module): fix Kubernetes version detection in templates (#986) chore(module): fix Kubernetes version detection in templates - Use discovery section instead of clusterConfiguration. - Module may start before node-manager module, so configuration section may not be in sync with the actual cluster state. Signed-off-by: Ivan Mikheykin <ivan.mikheykin@flant.com> Co-authored-by: Ivan Mikheykin <ivan.mikheykin@flant.com>
1 parent 3aa556f commit 17d7c50

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

templates/admission-policy.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{- $kubeVersion := .Values.global.clusterConfiguration.kubernetesVersion }}
1+
{{- $kubeVersion := .Values.global.discovery.kubernetesVersion }}
22
{{- $apiVersion := "" }}
33
{{- if semverCompare ">=1.30.0" $kubeVersion }}
44
{{- $apiVersion = "admissionregistration.k8s.io/v1" }}

templates/virtualization-controller/validation-webhook.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ webhooks:
241241
{{ .Values.virtualization.internal.controller.cert.ca | b64enc }}
242242
admissionReviewVersions: ["v1"]
243243
sideEffects: None
244-
{{- if semverCompare ">=1.27.0" .Values.global.clusterConfiguration.kubernetesVersion }}
244+
{{- if semverCompare ">=1.27.0" .Values.global.discovery.kubernetesVersion }}
245245
matchConditions:
246246
- name: 'match-virtualization'
247247
expression: 'request.name == "virtualization"'

0 commit comments

Comments
 (0)