Add validation that --emulation-version=<version>
>= DefaultKubeBinaryVersion
-3 #127514
Closed
Description
What would you like to be added?
Currently we have validation logic here:
// ValidateKubeEffectiveVersion validates the EmulationVersion is equal to the binary version at 1.31 for kube components.
// emulationVersion is introduced in 1.31, so it is only allowed to be equal to the binary version at 1.31.
func ValidateKubeEffectiveVersion(effectiveVersion EffectiveVersion) error {
binaryVersion := version.MajorMinor(effectiveVersion.BinaryVersion().Major(), effectiveVersion.BinaryVersion().Minor())
if binaryVersion.EqualTo(version.MajorMinor(1, 31)) && !effectiveVersion.EmulationVersion().EqualTo(binaryVersion) {
return fmt.Errorf("emulation version needs to be equal to binary version(%s) in compatibility-version alpha, got %s",
binaryVersion.String(), effectiveVersion.EmulationVersion().String())
}
return nil
}
That makes sure that --emulation-version=<version>
version
that is passed is >=1.31. Currently this check is enough as k8s latest release is 1.31 but the actual restriction for --emulation-version
is the current k8s binary version-3 (denoted as n-3
). As such the validation rule needs to be updated to prevent unsupported emulation versions for k8s versions v1.35+
Related PR comment denoted this future work: #126977 (comment)
Why is this needed?
This is needed as w/o this, users could set --emulation-version=<n-4> in the future (eg: k8s versions v1.35+
) which is not supported and could break them
/sig api-machinery