Skip to content

Commit e404e55

Browse files
authored
Merge pull request #35191 from michaelasp/deprecateallow
fix: Allowlist features that are deprecated then removed between k8s versions that are out of emulation version scope
2 parents d2dedc8 + 577af79 commit e404e55

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

config/jobs/kubernetes/sig-testing/compatibility-versions-e2e.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,10 @@ periodics:
208208
env:
209209
- name: RUNTIME_CONFIG
210210
value: '{"api/beta":"true", "api/ga":"true"}'
211+
# List of features that are not in scope of emulation version and have been removed. These can pass since they are not subject to the same policies as
212+
# feature gates that exist in components such as KCM.
213+
- name: REMOVED_FEATURE_LIST
214+
value: "LegacySidecarContainers"
211215
# we need privileged mode in order to do docker in docker
212216
securityContext:
213217
privileged: true
@@ -260,6 +264,10 @@ periodics:
260264
value: '{"api/beta":"true", "api/ga":"true"}'
261265
- name: VERSION_DELTA
262266
value: "2"
267+
# List of features that are not in scope of emulation version and have been removed. These can pass since they are not subject to the same policies as
268+
# feature gates that exist in components such as KCM.
269+
- name: REMOVED_FEATURE_LIST
270+
value: "LegacySidecarContainers"
263271
# we need privileged mode in order to do docker in docker
264272
securityContext:
265273
privileged: true

experiment/compatibility-versions/validate-compatibility-versions-feature-gates.sh

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ echo "Validating features for emulated_version=${emulated_version}, current_vers
3434
rm -f "${results_file}"
3535
touch "${results_file}"
3636

37+
# Obtain the list of features that have been removed fully and are not in scope of emulation version(e.g kubelet)
38+
REMOVED_FEATURE_LIST=${REMOVED_FEATURE_LIST:-''}
39+
3740
# Parse /metrics -> actual_features[featureName] = 0 or 1
3841
declare -A actual_features
3942
declare -A actual_stages
@@ -149,7 +152,7 @@ while IFS= read -r unversioned_feature_entry; do
149152
done < <(echo "$unversioned_feature_stream")
150153

151154
# For each "expected" feature (versioned):
152-
# - If missing from /metrics => fail unless stage==ALPHA or lock==true
155+
# - If missing from /metrics => fail unless stage==ALPHA or lock==true or is a deprecated feature that is listed as properly removed.
153156
# - If present & stage!=ALPHA => compare numeric value
154157
for feature_name in "${!expected_stage[@]}"; do
155158
stage="${expected_stage[$feature_name]}"
@@ -168,6 +171,12 @@ for feature_name in "${!expected_stage[@]}"; do
168171
continue
169172
fi
170173

174+
# Deprecated feature that was removed, these can continue. These can only be features that are not in the
175+
# scope of compatibility version(e.g kuebelet).
176+
if [[ "$REMOVED_FEATURE_LIST" == *"$feature_name"* ]]; then
177+
continue
178+
fi
179+
171180
echo "FAIL: expected feature gate '$feature_name' not found in metrics (stage=${stage}, lockToDefault=${locked})" \
172181
>> "${results_file}"
173182
continue
@@ -198,6 +207,11 @@ for unversioned_feature_name in "${!expected_unversioned_stage[@]}"; do
198207
if [[ "$unversioned_locked" == "true" ]]; then
199208
continue
200209
fi
210+
# Deprecated feature that was removed, these can continue. These can only be features that are not in the
211+
# scope of compatibility version(e.g kuebelet).
212+
if [[ "$REMOVED_FEATURE_LIST" == *"$feature_name"* ]]; then
213+
continue
214+
fi
201215
echo "FAIL: expected unversioned feature gate '$unversioned_feature_name' not found in metrics (lockToDefault=${unversioned_locked})" \
202216
>> "${results_file}"
203217
continue

0 commit comments

Comments
 (0)