mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 09:22:44 +00:00
integration etcd storage test
This commit is contained in:
parent
8fcb4b5773
commit
09c82fc58a
@ -275,10 +275,14 @@ func GetEtcdStorageDataForNamespaceServedAt(namespace string, v string, removeAl
|
|||||||
gvr("networking.k8s.io", "v1", "ipaddresses"): {
|
gvr("networking.k8s.io", "v1", "ipaddresses"): {
|
||||||
Stub: `{"metadata": {"name": "192.168.2.3"}, "spec": {"parentRef": {"resource": "services","name": "test", "namespace": "ns"}}}`,
|
Stub: `{"metadata": {"name": "192.168.2.3"}, "spec": {"parentRef": {"resource": "services","name": "test", "namespace": "ns"}}}`,
|
||||||
ExpectedEtcdPath: "/registry/ipaddresses/192.168.2.3",
|
ExpectedEtcdPath: "/registry/ipaddresses/192.168.2.3",
|
||||||
|
ExpectedGVK: gvkP("networking.k8s.io", "v1beta1", "IPAddress"),
|
||||||
|
IntroducedVersion: "1.33",
|
||||||
},
|
},
|
||||||
gvr("networking.k8s.io", "v1", "servicecidrs"): {
|
gvr("networking.k8s.io", "v1", "servicecidrs"): {
|
||||||
Stub: `{"metadata": {"name": "range-b2"}, "spec": {"cidrs": ["192.168.0.0/16","fd00:1::/120"]}}`,
|
Stub: `{"metadata": {"name": "range-b2"}, "spec": {"cidrs": ["192.168.0.0/16","fd00:1::/120"]}}`,
|
||||||
ExpectedEtcdPath: "/registry/servicecidrs/range-b2",
|
ExpectedEtcdPath: "/registry/servicecidrs/range-b2",
|
||||||
|
ExpectedGVK: gvkP("networking.k8s.io", "v1beta1", "ServiceCIDR"),
|
||||||
|
IntroducedVersion: "1.33",
|
||||||
},
|
},
|
||||||
// --
|
// --
|
||||||
|
|
||||||
|
@ -45,6 +45,7 @@ import (
|
|||||||
featuregatetesting "k8s.io/component-base/featuregate/testing"
|
featuregatetesting "k8s.io/component-base/featuregate/testing"
|
||||||
componentbaseversion "k8s.io/component-base/version"
|
componentbaseversion "k8s.io/component-base/version"
|
||||||
"k8s.io/kubernetes/cmd/kube-apiserver/app/options"
|
"k8s.io/kubernetes/cmd/kube-apiserver/app/options"
|
||||||
|
"k8s.io/kubernetes/pkg/features"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Only add kinds to this list when this a virtual resource with get and create verbs that doesn't actually
|
// Only add kinds to this list when this a virtual resource with get and create verbs that doesn't actually
|
||||||
@ -94,6 +95,14 @@ func testEtcdStoragePathWithVersion(t *testing.T, v string) {
|
|||||||
// Only test for beta and GA APIs with emulated version.
|
// Only test for beta and GA APIs with emulated version.
|
||||||
featuregatetesting.SetFeatureGateEmulationVersionDuringTest(t, feature.DefaultFeatureGate, version.MustParse(v))
|
featuregatetesting.SetFeatureGateEmulationVersionDuringTest(t, feature.DefaultFeatureGate, version.MustParse(v))
|
||||||
featuregatetesting.SetFeatureGateDuringTest(t, feature.DefaultFeatureGate, "AllBeta", true)
|
featuregatetesting.SetFeatureGateDuringTest(t, feature.DefaultFeatureGate, "AllBeta", true)
|
||||||
|
// Feature Gates that are GA and depend directly on the API version to work can not be emulated in previous versions.
|
||||||
|
// Example feature:
|
||||||
|
// v1.x-2 : FeatureGate alpha , API v1alpha1/feature
|
||||||
|
// v1.x-1 : FeatureGate beta , API v1beta1/feature
|
||||||
|
// v1.x : FeatureGate GA , API v1/feature
|
||||||
|
// The code in v1.x uses the clients with the v1 API, if we emulate v1.x-1 it will not work against apiserver that
|
||||||
|
// only understand v1beta1.
|
||||||
|
featuregatetesting.SetFeatureGateDuringTest(t, feature.DefaultFeatureGate, features.MultiCIDRServiceAllocator, false)
|
||||||
}
|
}
|
||||||
registerEffectiveEmulationVersion(t)
|
registerEffectiveEmulationVersion(t)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user