Skip to content

Commit

Permalink
Integration tests should use 'kubectl explain --output plaintext-open…
Browse files Browse the repository at this point in the history
…apiv2'

- OpenAPIV3 discovery of aggregate APIs seems to need a little more work in K8s 1.28
  • Loading branch information
joshuatcasey committed Aug 25, 2023
1 parent a036ae7 commit 35ad6a3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions internal/concierge/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Check warning on line 234 in internal/concierge/server/server.go

View check run for this annotation

Codecov / codecov/patch

internal/concierge/server/server.go#L231-L234

Added lines #L231 - L234 were not covered by tests
// Note that among other things, this ApplyTo() function copies
// `recommendedOptions.SecureServing.ServerCert.GeneratedCert` into
// `serverConfig.SecureServing.Cert` thus making `dynamicCertProvider`
Expand Down
2 changes: 2 additions & 0 deletions internal/supervisor/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
2 changes: 1 addition & 1 deletion test/integration/kube_api_discovery_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 35ad6a3

Please sign in to comment.