-
Notifications
You must be signed in to change notification settings - Fork 408
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
[yurthub] support cache response for partial object metadata requests。 #2170
[yurthub] support cache response for partial object metadata requests。 #2170
Conversation
@vie-serendipity PTAL |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2170 +/- ##
==========================================
+ Coverage 56.09% 59.05% +2.95%
==========================================
Files 186 211 +25
Lines 18092 19070 +978
==========================================
+ Hits 10149 11261 +1112
+ Misses 6910 6726 -184
- Partials 1033 1083 +50
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
3c7c926
to
667a6ee
Compare
pkg/yurthub/proxy/util/util.go
Outdated
var gvk schema.GroupVersionKind | ||
acceptHeader := req.Header.Get("Accept") | ||
parts := strings.Split(acceptHeader, ";") | ||
for _, part := range parts { |
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.
I noticed kubernetes use goautoneg
to parse accept, I think that might be better to some corner cases.
clauses := goautoneg.ParseAccept(header)
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.
fixed.
667a6ee
to
a5601c3
Compare
a5601c3
to
2c8b065
Compare
…, like the following request: curl -H "Accept: application/json;as=PartialObjectMetadataList;g=meta.k8s.io;v=v1" "$API_SERVER/apis/apiextensions.k8s.io/v1/customresourcedefinitions" Signed-off-by: rambohe-ch <[email protected]>
2c8b065
to
b92602e
Compare
Quality Gate failedFailed conditions |
/LGTM @rambohe-ch |
…, like the following request: (openyurtio#2170) curl -H "Accept: application/json;as=PartialObjectMetadataList;g=meta.k8s.io;v=v1" "$API_SERVER/apis/apiextensions.k8s.io/v1/customresourcedefinitions" Signed-off-by: rambohe-ch <[email protected]>
What type of PR is this?
/kind bug
What this PR does / why we need it:
support cache response for partial object metadata requests, like the following request:
Which issue(s) this PR fixes:
Fixes #2121
Special notes for your reviewer:
Does this PR introduce a user-facing change?
other Note