-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Support registering APIService in envtest #1448
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
Comments
With #1449 it's now possible to configure the test environment's API server's aggregation layer in order to register Example: testEnv.ControlPlane.APIServer.Args = append(envtest.DefaultKubeAPIServerFlags,
"--client-ca-file={{ .CertDir }}/apiserver-ca.crt",
"--proxy-client-key-file={{ .CertDir }}/apiserver.key",
"--proxy-client-cert-file={{ .CertDir }}/apiserver.crt",
"--requestheader-client-ca-file={{ .CertDir }}/apiserver-ca.crt",
"--requestheader-extra-headers-prefix=X-Remote-Extra-",
"--requestheader-group-headers=X-Remote-Group",
"--requestheader-username-headers=X-Remote-User",
)
// start testEnv...
// start extension API server (configure delegating authn/authz as usual)
// create client with `apiregistration` in its scheme...
err := c.Create(ctx, &apiregistrationv1.APIService{ /* ... */ })
// talk to extension API server as usual
err = c.List(ctx, &yourextendedapi.SomeResourceList{}) See example usage for a more details. |
Let me know, if there is interest in simplifying this scenario even further. Though, I assume that most folks using controller-runtime are rather working with CRDs, which are already well-supported by |
here is an updated example for how to configure the aggregation layer in envtest with [email protected] and #1541. |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
Sine envtest mainly target's controllers working on CRDs and given that it's still fairly simple to register an |
@timebertt: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Currently,
envtest
primarily supports controllers working on resources registered by CRDs.We would like to leverage
envtest
for writing integration tests for resources provided by an extension API server and registered viaAPIService
s as well.The text was updated successfully, but these errors were encountered: