From 46b13d48e200a0fe720e506e4225a6ef38baf637 Mon Sep 17 00:00:00 2001 From: Antonio Ojea Date: Sun, 29 Jan 2023 14:05:11 +0000 Subject: [PATCH] etcd data Change-Id: I31c3a1c8fee7f3a681186b934bd7c6b36baee6df --- test/integration/apiserver/apply/reset_fields_test.go | 5 +++++ test/integration/etcd/data.go | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/test/integration/apiserver/apply/reset_fields_test.go b/test/integration/apiserver/apply/reset_fields_test.go index 13dbc49f3a4..fd7e6832ae6 100644 --- a/test/integration/apiserver/apply/reset_fields_test.go +++ b/test/integration/apiserver/apply/reset_fields_test.go @@ -65,6 +65,7 @@ var resetFieldsStatusData = map[schema.GroupVersionResource]string{ // standard for []metav1.Condition gvr("admissionregistration.k8s.io", "v1alpha1", "validatingadmissionpolicies"): `{"status": {"conditions":[{"type":"Accepted","status":"True","lastTransitionTime":"2020-01-01T00:00:00Z","reason":"RuleApplied","message":"Rule was applied"}]}}`, gvr("admissionregistration.k8s.io", "v1beta1", "validatingadmissionpolicies"): `{"status": {"conditions":[{"type":"Accepted","status":"True","lastTransitionTime":"2020-01-01T00:00:00Z","reason":"RuleApplied","message":"Rule was applied"}]}}`, + gvr("networking.k8s.io", "v1alpha1", "servicecidrs"): `{"status": {"conditions":[{"type":"Accepted","status":"True","lastTransitionTime":"2020-01-01T00:00:00Z","reason":"RuleApplied","message":"Rule was applied"}]}}`, } // resetFieldsStatusDefault conflicts with statusDefault @@ -81,6 +82,9 @@ var noConflicts = map[string]struct{}{ // storageVersions are skipped because their spec is empty // and thus they can never have a conflict. "storageversions": {}, + // servicecidrs are skipped because their spec is inmutable + // and thus they can never have a conflict. + "servicecidrs": {}, // namespaces only have a spec.finalizers field which is also skipped, // thus it will never have a conflict. "namespaces": {}, @@ -134,6 +138,7 @@ var resetFieldsSpecData = map[schema.GroupVersionResource]string{ gvr("extensions", "v1beta1", "ingresses"): `{"spec": {"backend": {"serviceName": "service2"}}}`, gvr("networking.k8s.io", "v1beta1", "ingresses"): `{"spec": {"backend": {"serviceName": "service2"}}}`, gvr("networking.k8s.io", "v1", "ingresses"): `{"spec": {"defaultBackend": {"service": {"name": "service2"}}}}`, + gvr("networking.k8s.io", "v1alpha1", "servicecidrs"): `{}`, gvr("policy", "v1", "poddisruptionbudgets"): `{"spec": {"selector": {"matchLabels": {"anokkey2": "anokvalue"}}}}`, gvr("policy", "v1beta1", "poddisruptionbudgets"): `{"spec": {"selector": {"matchLabels": {"anokkey2": "anokvalue"}}}}`, gvr("storage.k8s.io", "v1alpha1", "volumeattachments"): `{"metadata": {"name": "va3"}, "spec": {"nodeName": "localhost2"}}`, diff --git a/test/integration/etcd/data.go b/test/integration/etcd/data.go index 2212a90db54..a3f4d6775d8 100644 --- a/test/integration/etcd/data.go +++ b/test/integration/etcd/data.go @@ -210,6 +210,13 @@ func GetEtcdStorageDataForNamespace(namespace string) map[schema.GroupVersionRes }, // -- + // k8s.io/kubernetes/pkg/apis/networking/v1alpha1 + gvr("networking.k8s.io", "v1alpha1", "servicecidrs"): { + Stub: `{"metadata": {"name": "range1"}, "spec": {"ipv4": "192.168.0.0/16", "ipv6": "fd00:1::/120"}}`, + ExpectedEtcdPath: "/registry/servicecidrs/range1", + }, + // -- + // k8s.io/kubernetes/pkg/apis/policy/v1 gvr("policy", "v1", "poddisruptionbudgets"): { Stub: `{"metadata": {"name": "pdbv1"}, "spec": {"selector": {"matchLabels": {"anokkey": "anokvalue"}}}}`,