-
Notifications
You must be signed in to change notification settings - Fork 336
feat(platform): proxy cluster version api #1142
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
Conversation
| client, err := proxy.ClientSet(req.Request.Context(), platformClient) | ||
| if err != nil { | ||
| resp.WriteHeaderAndEntity(http.StatusBadRequest, "err1"+err.Error()) | ||
| return |
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.
why err1 rather than "err.Error()"
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.
to keep compatibility, please add logic to check if token or client crt/key pass to back-end, then proxy the request to remote k8s server, otherwise get version info from local
|
|
||
| if err != nil { | ||
| resp.WriteHeaderAndEntity(http.StatusInternalServerError, "err2"+err.Error()) | ||
| return |
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.
why "err2"?
| @@ -0,0 +1,51 @@ | |||
| package apiserver | |||
|
|
|||
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.
- please place and rename this file to tke/pkg/platform/proxy/version/rest/storage.go
- add some comments to highlight this new feature: how to add new rest api which doesn't belong to native k8s resouce to tke-platform-api
- xx
- yy
|
please fix CI build issue |
b412bb1 to
5fc64a1
Compare
This reverts commit ea282b5.
What type of PR is this?
fix #1134
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?:
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: