Skip to content

Commit 5e4c562

Browse files
authored
chore(t8s-cluster/management-cluster): remove cloud-provider flag >= 1.33.0 (#1579)
See <https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG/CHANGELOG-1.33.md#other-cleanup-or-flake-1> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Improved version comparison logic to prevent usage of removed flags. * The "cloud-provider: external" argument is now only included for Kubernetes versions below 1.33.0. * Kubelet image pull concurrency patch now correctly applies only for Kubernetes versions 1.27.0 and above. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent fbc9519 commit 5e4c562

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

charts/t8s-cluster/templates/management-cluster/check-k8s-version.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
{{- $existingCluster := lookup $cluster.apiVersion $cluster.kind $cluster.metadata.namespace $cluster.metadata.name }}
33
{{/* Should always pass, just doesn't work for local diffs 😥 */}}
44
{{- if $existingCluster }}
5-
{{- if semverCompare (printf "<%s" ($existingCluster.spec.version | trimPrefix "v")) (printf "%d.%d.%d" (.Values.version.major | int) (.Values.version.minor | int) (.Values.version.patch | int)) -}}
5+
{{- if semverCompare (printf "<%s" ($existingCluster.spec.version | trimPrefix "v")) (include "t8s-cluster.k8s-version" .) -}}
66
{{- fail "Cannot downgrade cluster version" -}}
77
{{- end }}
88
{{- end }}

charts/t8s-cluster/templates/management-cluster/clusterClass/_helpers.tpl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,10 @@ server = {{ printf "https://%s" .registry | quote }}
143143
{{- end }}
144144

145145
{{- define "t8s-cluster.clusterClass.args.sharedController" -}}
146-
{{- $args := dict "cloud-provider" "external" -}}
146+
{{- $args := dict -}}
147+
{{- if semverCompare "<1.33.0" (include "t8s-cluster.k8s-version" .context) -}}
148+
{{- $args = set $args "cloud-provider" "external" -}}
149+
{{- end -}}
147150
{{- toYaml $args -}}
148151
{{- end }}
149152

charts/t8s-cluster/templates/management-cluster/clusterClass/patches/_kubelet.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{{- define "t8s-cluster.patches.kubelet.imagePulls" -}}
22
{{- $_ := mustMerge . (pick .context "Values") -}}
33
{{- $values := dict -}}
4-
{{- if and (or (gt (.Values.version.major | int) 1) (ge (.Values.version.minor | int) 27)) (gt (int .Values.global.kubeletExtraConfig.maxParallelImagePulls) 1) -}}
4+
{{- if and (semverCompare ">=1.27.0" (include "t8s-cluster.k8s-version" .context)) (gt (int .Values.global.kubeletExtraConfig.maxParallelImagePulls) 1) -}}
55
{{- $values = mustMerge $values (dict "serializeImagePulls" false "maxParallelImagePulls" .Values.global.kubeletExtraConfig.maxParallelImagePulls) -}}
66
{{- end -}}
77
{{- toYaml $values -}}

0 commit comments

Comments
 (0)