From ca05969f8de58c78ce5a96159d35b66b827ef583 Mon Sep 17 00:00:00 2001 From: Joshua Casey Date: Thu, 24 Aug 2023 13:08:15 -0500 Subject: [PATCH] Integration tests should use 'kubectl explain --output plaintext-openapiv2' - OpenAPIV3 discovery of aggregate APIs seems to need a little more work in K8s 1.28 --- internal/concierge/server/server.go | 2 ++ internal/supervisor/server/server.go | 2 ++ test/integration/kube_api_discovery_test.go | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/concierge/server/server.go b/internal/concierge/server/server.go index 3c304ef7..e4df17ce 100644 --- a/internal/concierge/server/server.go +++ b/internal/concierge/server/server.go @@ -228,8 +228,10 @@ func getAggregatedAPIServerConfig( // `kubectl explain` to work for the Concierge's aggregated API resources. serverConfig.OpenAPIConfig = genericapiserver.DefaultOpenAPIConfig( conciergeopenapi.GetOpenAPIDefinitions, openapinamer.NewDefinitionNamer(scheme)) + // serverConfig.OpenAPIConfig.Info.InfoProps.Title = "Pinniped Concierge" serverConfig.OpenAPIV3Config = genericapiserver.DefaultOpenAPIV3Config( conciergeopenapi.GetOpenAPIDefinitions, openapinamer.NewDefinitionNamer(scheme)) + // serverConfig.OpenAPIV3Config.Info.InfoProps.Title = "Pinniped Concierge" // Note that among other things, this ApplyTo() function copies // `recommendedOptions.SecureServing.ServerCert.GeneratedCert` into // `serverConfig.SecureServing.Cert` thus making `dynamicCertProvider` diff --git a/internal/supervisor/server/server.go b/internal/supervisor/server/server.go index 670ace76..250c53e9 100644 --- a/internal/supervisor/server/server.go +++ b/internal/supervisor/server/server.go @@ -613,8 +613,10 @@ func getAggregatedAPIServerConfig( // `kubectl explain` to work for the Supervisor's aggregated API resources. serverConfig.OpenAPIConfig = genericapiserver.DefaultOpenAPIConfig( supervisoropenapi.GetOpenAPIDefinitions, openapinamer.NewDefinitionNamer(scheme)) + // serverConfig.OpenAPIConfig.Info.InfoProps.Title = "Pinniped Supervisor" serverConfig.OpenAPIV3Config = genericapiserver.DefaultOpenAPIV3Config( supervisoropenapi.GetOpenAPIDefinitions, openapinamer.NewDefinitionNamer(scheme)) + // serverConfig.OpenAPIV3Config.Info.InfoProps.Title = "Pinniped Supervisor" // Note that among other things, this ApplyTo() function copies // `recommendedOptions.SecureServing.ServerCert.GeneratedCert` into // `serverConfig.SecureServing.Cert` thus making `dynamicCertProvider` diff --git a/test/integration/kube_api_discovery_test.go b/test/integration/kube_api_discovery_test.go index 9d7f63e8..38aabd13 100644 --- a/test/integration/kube_api_discovery_test.go +++ b/test/integration/kube_api_discovery_test.go @@ -701,7 +701,7 @@ func runKubectlVersion(t *testing.T) { func runKubectlExplain(t *testing.T, resourceName string, apiVersion string) string { t.Helper() var stdOut, stdErr bytes.Buffer - cmd := exec.Command("kubectl", "explain", resourceName, "--api-version", apiVersion) + cmd := exec.Command("kubectl", "explain", resourceName, "--api-version", apiVersion, "--output", "plaintext-openapiv2") t.Log("Running:", cmd.String()) cmd.Stdout = &stdOut cmd.Stderr = &stdErr