Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Discovery (kubectl explain) should work for OpenAPIv3 and aggregate APIs #1643

Open
joshuatcasey opened this issue Aug 25, 2023 · 0 comments
Labels
enhancement New feature or request priority/undecided Not yet prioritized

Comments

@joshuatcasey
Copy link
Member

joshuatcasey commented Aug 25, 2023

When bumping to K8s 1.28, we noticed a lot of integration test flakes that looked like this:

https://hush-house.pivotal.io/teams/tanzu-user-auth/pipelines/pinniped-pull-requests/jobs/integration-test-1.24/builds/323#L647c53da:2463:2482

=== CONT  TestIntegrationSerial/TestGetAPIResourceList/every_API_can_show_its_docs_to_the_user_via_kubectl_explain,_including_aggregated_APIs,_and_everything_has_a_description
    kube_api_discovery_test.go:418: Running: kubectl version
=== CONT  TestIntegrationSerial/TestGetAPIResourceList/every_Pinniped_API_has_explicit_test_coverage
=== CONT  TestIntegrationSerial/TestGetAPIResourceList/config.supervisor.pinniped.dev
    kube_api_discovery_test.go:418: Client Version: v1.28.0
        Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
        Server Version: v1.24.15
        WARNING: version difference between client (1.28) and server (1.24) exceeds the supported minor version skew of +/-1
        
    kube_api_discovery_test.go:618: Running: /bin/kubectl explain oidcclientsecretrequests --api-version clientsecret.supervisor.pinniped.dev/v1alpha1
    kube_api_discovery_test.go:618: Running kubectl explain had non-zero exit code.
        kubectl explain stdout: 
        kubectl explain stderr: error: couldn't find resource for "clientsecret.supervisor.pinniped.dev/v1alpha1, Resource=oidcclientsecretrequests"
    kube_api_discovery_test.go:618: 
        	Error Trace:	/work/test/integration/kube_api_discovery_test.go:714
        	            				/work/test/integration/kube_api_discovery_test.go:618
        	            				/work/test/integration/kube_api_discovery_test.go:436
        	Error:      	Received unexpected error:
        	            	exit status 1
        	Test:       	TestIntegrationSerial/TestGetAPIResourceList/every_API_can_show_its_docs_to_the_user_via_kubectl_explain,_including_aggregated_APIs,_and_everything_has_a_description

It appears that there is some kind of issue holding on to this API discovery information. Note that there are a handful of issues and PRs related to OpenAPIV3 and aggregate API discovery in open source Kubernetes.

Note that the aggregate APIs is used in many, many different integration tests, and we never saw that actually fail. The issue seems to be solely around OpenAPIV3 discovery (first introduced in K8s 1.28). If we force the client to use OpenAPIV2 (by setting kubectl explain --output plaintext-openapiv2) then we do not see this source of flakiness.

@pinniped-ci-bot pinniped-ci-bot added enhancement New feature or request priority/undecided Not yet prioritized labels Aug 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request priority/undecided Not yet prioritized
Projects
None yet
Development

No branches or pull requests

2 participants