-
Notifications
You must be signed in to change notification settings - Fork 388
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
✨ Add OpenAPI Schema support to virtual workspace framework #3059
base: main
Are you sure you want to change the base?
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Hi @palnabarun. Thanks for your PR. I'm waiting for a kcp-dev member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
9e78baa
to
07deb4f
Compare
for gvr, apiDefinition := range apiSet { | ||
if group == "" || (group != "" && group == gvr.Group) { | ||
spec := apiDefinition.GetOpenAPIV3Spec() | ||
h.openAPIV3Service.UpdateGroupVersion(gvr.Group, spec) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this synchronous?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It lazily updates the cache, IIUC.
Can you add an e2e test? Am interested to see the schema for exported and claimed resources (both APIResourceSchemas and native resources) of an APIExport. |
07deb4f
to
8105fcf
Compare
@sttts Sure. I will explore the tests. Can you also add the |
/ok-to-test |
8105fcf
to
f85a4fe
Compare
Signed-off-by: Nabarun Pal <[email protected]>
f85a4fe
to
e5495bd
Compare
I think I might need this. I'm trying to implement a virtual workspace using the fixedgvs abstraction, but it keeps blowing up with "OpenAPIV3 config must not be nil". |
@@ -330,3 +332,86 @@ func sortGroupDiscoveryByKubeAwareVersion(gd []metav1.GroupVersionForDiscovery) | |||
return version.CompareKubeAwareVersionStrings(gd[i].Version, gd[j].Version) > 0 | |||
}) | |||
} | |||
|
|||
type openAPIHandler struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you describe on the high level how this handler gets a v3 schema for the right resources?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
go doc I mean
w, r) | ||
} | ||
|
||
h.openAPIV3Service.HandleGroupVersion(w, r) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I am not mistaken, die service is not workspace and binding aware.
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with /lifecycle stale |
/remove-lifecycle stale |
Hey @palnabarun, the 1.30 rebase is done now. Would you be interested in picking up this work again? |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with /lifecycle stale |
@xmudrii wants to take this up further. He will carry it forward. |
Summary
Add OpenAPI Schema support to virtual workspace framework.
The implementation taps into the
CreateServingInfo
path to generate the spec and adds a handler to VW apiserver for handling the request and updating the OpenAPI v3 service caches.TODO: OpenAPI v2 support and structuring the code for merge.
Related issue(s)
None
Release Notes