@@ -88,6 +88,29 @@ check_structured_log_support() {
88
88
esac
89
89
}
90
90
91
+ # Function to check if version is greater than or equal to the target
92
+ version_gte () {
93
+ local version=$1
94
+ local target=$2
95
+
96
+ # Extract major and minor versions
97
+ local version_major version_minor
98
+ version_major=$( echo " $version " | cut -d. -f1)
99
+ version_minor=$( echo " $version " | cut -d. -f2)
100
+
101
+ local target_major target_minor
102
+ target_major=$( echo " $target " | cut -d. -f1)
103
+ target_minor=$( echo " $target " | cut -d. -f2)
104
+
105
+ # Compare major version first, then minor
106
+ if [ " $version_major " -gt " $target_major " ]; then
107
+ return 0
108
+ elif [ " $version_major " -eq " $target_major " ] && [ " $version_minor " -ge " $target_minor " ]; then
109
+ return 0
110
+ fi
111
+ return 1
112
+ }
113
+
91
114
# up a cluster with kind
92
115
create_cluster () {
93
116
# Default Log level for all components in test clusters
@@ -148,6 +171,12 @@ create_cluster() {
148
171
;;
149
172
esac
150
173
174
+ # Conditionally include the emulation-forward-compatible flag based on version
175
+ emulation_forward_compatible=" "
176
+ if version_gte " ${PREV_VERSION} " " 1.33" ; then
177
+ emulation_forward_compatible=" \" emulation-forward-compatible\" : \" true\" "
178
+ fi
179
+
151
180
# create the config file
152
181
cat << EOF > "${ARTIFACTS} /kind-config.yaml"
153
182
# config for 1 control plane node and 2 workers (necessary for conformance)
@@ -173,8 +202,8 @@ kubeadmConfigPatches:
173
202
apiServer:
174
203
extraArgs:
175
204
${apiServer_extra_args}
176
- "emulated-version": "${EMULATED_VERSION} "
177
- "emulation-forward-compatible": "true"
205
+ "emulated-version": "${EMULATED_VERSION} "${emulation_forward_compatible : +
206
+ $emulation_forward_compatible }
178
207
controllerManager:
179
208
extraArgs:
180
209
${controllerManager_extra_args}
0 commit comments