-
Notifications
You must be signed in to change notification settings - Fork 40k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bump DefaultKubeBinaryVersion to 1.33 #128279
Changes from all commits
4e8477b
cf28c04
dc476e9
6c94adc
59fcd7b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. let's find a way to retain coverage for this specific test for types which can only be served under emulation, while minimizing the diff to etcd/data. Something like this: diff --git a/test/integration/etcd/data.go b/test/integration/etcd/data.go
index d2ef43b7c9c..93b20c025d9 100644
--- a/test/integration/etcd/data.go
+++ b/test/integration/etcd/data.go
@@ -29,7 +29,7 @@ import (
// It is exported so that it can be reused across multiple tests.
// It returns a new map on every invocation to prevent different tests from mutating shared state.
func GetEtcdStorageData() map[schema.GroupVersionResource]StorageData {
- return GetEtcdStorageDataForNamespace("etcdstoragepathtestnamespace")
+ return GetEtcdStorageDataForNamespaceServedAt("etcdstoragepathtestnamespace", utilversion.DefaultKubeEffectiveVersion().BinaryVersion().String(), true)
}
// GetEtcdStorageDataForNamespace returns etcd data for all persisted objects.
@@ -37,6 +37,10 @@ func GetEtcdStorageData() map[schema.GroupVersionResource]StorageData {
// It returns a new map on every invocation to prevent different tests from mutating shared state.
// Namespaced objects keys are computed for the specified namespace.
func GetEtcdStorageDataForNamespace(namespace string) map[schema.GroupVersionResource]StorageData {
+ return GetEtcdStorageDataForNamespaceServedAt(namespace, utilversion.DefaultKubeEffectiveVersion().BinaryVersion().String(), true)
+}
+
+func GetEtcdStorageDataForNamespaceServedAt(namespace string, emulationVersion string, includeAlpha bool) map[schema.GroupVersionResource]StorageData {
image := image.GetE2EImage(image.BusyBox)
etcdStorageData := map[schema.GroupVersionResource]StorageData{
// k8s.io/kubernetes/pkg/api/v1
@@ -481,6 +485,23 @@ func GetEtcdStorageDataForNamespace(namespace string) map[schema.GroupVersionRes
ExpectedEtcdPath: "/registry/csidrivers/csid2",
}
+ // ... delete stuff no longer served or not yet added at at emulatedVersion
+ // TODO: derive this programtically from gvk --> instance --> APILifecycle info
+ switch emulatedVersion {
+ case "1.33":
+ // delete flowcontrol
+ case "1.32":
+ // delete flowcontrol
+ // delete mutatingadmission
+ case "1.31":
+ // delete mutatingadmission
+ default:
+ error
+ }
+ if !includeAlpha {
+ // drop all alphas from etcdStorageData
+ }
+
return etcdStorageData
}
diff --git a/test/integration/etcd/etcd_storage_path_test.go b/test/integration/etcd/etcd_storage_path_test.go
index bedc000856b..e909e4ee61b 100644
--- a/test/integration/etcd/etcd_storage_path_test.go
+++ b/test/integration/etcd/etcd_storage_path_test.go
@@ -75,13 +75,19 @@ var allowMissingTestdataFixtures = map[schema.GroupVersionKind]bool{
// It will also fail when a type gets moved to a different location. Be very careful in this situation because
// it essentially means that you will be break old clusters unless you create some migration path for the old data.
func TestEtcdStoragePath(t *testing.T) {
+ testEtcdStoragePathAtVersion(t, utilversion.DefaultKubeEffectiveVersion().BinaryVersion().String(), true)
+ testEtcdStoragePathAtVersion(t, utilversion.DefaultKubeEffectiveVersion().BinaryVersion().SubtractMinor(1).String(), false)
+ testEtcdStoragePathAtVersion(t, utilversion.DefaultKubeEffectiveVersion().BinaryVersion().SubtractMinor(2).String(), false)
+}
+
+func testEtcdStoragePathAtVersion(t *testing.T, emulateVersion string, includeAlpha bool) {
// KUBE_APISERVER_SERVE_REMOVED_APIS_FOR_ONE_RELEASE allows for APIs pending removal to not block tests
t.Setenv("KUBE_APISERVER_SERVE_REMOVED_APIS_FOR_ONE_RELEASE", "true")
featuregatetesting.SetFeatureGateDuringTest(t, feature.DefaultFeatureGate, "AllAlpha", true)
featuregatetesting.SetFeatureGateDuringTest(t, feature.DefaultFeatureGate, "AllBeta", true)
- apiServer := StartRealAPIServerOrDie(t)
+ apiServer := StartRealAPIServerOrDie(t, withEmulationVersion(emulateVersion))
defer apiServer.Cleanup()
defer dumpEtcdKVOnFailure(t, apiServer.KV)
@@ -91,7 +97,7 @@ func TestEtcdStoragePath(t *testing.T) {
t.Fatal(err)
}
- etcdStorageData := GetEtcdStorageData()
+ etcdStorageData := GetEtcdStorageDataForNamespaceServedAt("etcdstoragepathtestnamespace", emulateVersion, includeAlpha)
kindSeen := sets.NewString()
pathSeen := map[string][]schema.GroupVersionResource{}
diff --git a/test/integration/etcd/server.go b/test/integration/etcd/server.go
index 03911859aaf..08df976cbe8 100644
--- a/test/integration/etcd/server.go
+++ b/test/integration/etcd/server.go
@@ -62,6 +62,19 @@ AwEHoUQDQgAEH6cuzP8XuD5wal6wf9M6xDljTOPLX2i8uIp/C/ASqiIGUeeKQtX0
/IR3qCXyThP/dbCiHrF3v1cuhBOHY8CLVg==
-----END EC PRIVATE KEY-----`
+func withEmulationVersion(emulationVersion string) func(*options.ServerRunOptions) {
+ return func(*options.ServerRunOptions) {
+ featureGate := feature.DefaultMutableFeatureGate
+ featureGate.AddMetrics()
+
+ effectiveVersion := utilversion.DefaultKubeEffectiveVersion()
+ effectiveVersion.SetEmulationVersion(featureGate.EmulationVersion())
+ featuregatetesting.SetFeatureGateEmulationVersionDuringTest(t, featureGate, effectiveVersion.EmulationVersion())
+ featuregate.DefaultComponentGlobalsRegistry.Reset()
+ utilruntime.Must(featuregate.DefaultComponentGlobalsRegistry.Register(featuregate.DefaultKubeComponent, effectiveVersion, featureGate))
+ }
+}
+
// StartRealAPIServerOrDie starts an API server that is appropriate for use in tests that require one of every resource
func StartRealAPIServerOrDie(t *testing.T, configFuncs ...func(*options.ServerRunOptions)) *APIServer {
tCtx := ktesting.Init(t)
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. any API objects which change their storage version depending on emulation version will need to calculate their expected GVK from the incoming emulationVersion as well, for example:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
ack, we do not have any instances of this at the moment and it'll probably occur on our next GA API promotion. I've addressed the other diffs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was updated because the original test was not written to check the actual values of the mapping, just a placeholder for a mapping exist. So it is actually mapping test 2.8 to kube 2.11, which is not aligned with the kube binary at all.
This change fixes the test to the correct version mapping.
cc @siyuanfoundation @liggitt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is adding 23 to the minor correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mapping is from test component 2.7 -> kube 1.30 and 2.8 -> kube 1.31 which is where the +23 was derived from specifically for this test.