From 4a5fe2decad41c4a14b06f66397b547908bcdf1c Mon Sep 17 00:00:00 2001 From: Harish Kuna Date: Tue, 5 Mar 2024 01:00:50 +0000 Subject: [PATCH] Addd negative case for the fix in #123570 --- .../pkg/controllers/openapi/aggregator/aggregator_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/staging/src/k8s.io/kube-aggregator/pkg/controllers/openapi/aggregator/aggregator_test.go b/staging/src/k8s.io/kube-aggregator/pkg/controllers/openapi/aggregator/aggregator_test.go index 34c586bab09a3..f1af06d059101 100644 --- a/staging/src/k8s.io/kube-aggregator/pkg/controllers/openapi/aggregator/aggregator_test.go +++ b/staging/src/k8s.io/kube-aggregator/pkg/controllers/openapi/aggregator/aggregator_test.go @@ -210,6 +210,7 @@ func TestAPIServiceOpenAPIServiceMismatch(t *testing.T) { expectPath(t, swagger, "/apis/apiservicegroup/v1") expectPath(t, swagger, "/apis/apiservicegroup/v2") expectPath(t, swagger, "/apis/apiregistration.k8s.io/v1") + expectNoPath(t, swagger, "/apis/a") t.Logf("Remove APIService %s", apiService.Name) s.RemoveAPIService(apiService.Name) @@ -221,6 +222,7 @@ func TestAPIServiceOpenAPIServiceMismatch(t *testing.T) { // Ensure that the if the APIService is added then removed, the OpenAPI disappears from the aggregated OpenAPI as well. expectNoPath(t, swagger, "/apis/apiservicegroup/v1") expectPath(t, swagger, "/apis/apiregistration.k8s.io/v1") + expectNoPath(t, swagger, "/apis/a") } func TestAddRemoveAPIService(t *testing.T) {