-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Kubectl to use http caching to cache openapi responses from the server #50404
Conversation
Looks like I forgot to commit the new |
621849b
to
932f58a
Compare
e53f6cb
to
06df1b2
Compare
PTAL @liggitt |
/retest |
if err != nil { | ||
t.Fatal(err) | ||
} | ||
if rt.Request.Header.Get("If-None-Match") != "" { |
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.
Lets write a test that can check what was actually stored to verify nothing was written to the cache.
One note about additional testing, otherwise lgtm. |
@liggitt My understanding is that this is consistent with how the caching libraries expect things. I think in the ideal solution, the server would define the caching behavior in the response header to tell all clients whether or not to cache the result (e.g. browsers, other language clients, etc would know what to do). The vendored client cache library is also supposed to allow the caching behavior to be controlled by the client if it is specified in the request headers, so the client could send a no-store control header and the client wouldn't cache it even without the plumbing logic in the PR. So the code is (now) partially redundant, but more explicit in what it is doing vs depending on implementation details of the vendored code. |
/retest |
2 similar comments
/retest |
/retest |
OK Looks like we have consensus on that, can we have approval and lgtm? @liggitt @smarterclayton |
/lgtm |
@smarterclayton I'd really like if you could approve that, but I'll look for another approver. |
What is the flag name? It should be in the release note. Also, the convention is to separate words with hyphens. What K8s components will use this? The release note should specify that, also, since it's probably not obvious to users what will be affected by this change. |
Only cache discovery requests, and only for kubectl.
@bgrant0607 Updated the release note, renamed the flag, PTAL |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: apelisse, bgrant0607, liggitt Associated issue: 50254 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
/test all |
/retest |
/retest Review the full test history for this PR. |
1 similar comment
/retest Review the full test history for this PR. |
Automatic merge from submit-queue (batch tested with PRs 51480, 49616, 50123, 50846, 50404) |
…ke-openapi Automatic merge from submit-queue (batch tested with PRs 51682, 51546, 51369, 50924, 51827) Remove duplicate fake and unused openapi **What this PR does / why we need it**: Follow-up on PR kubernetes#50404 **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes # **Special notes for your reviewer**: **Release note**: ```release-note NONE ```
What this PR does / why we need it:
This PR is trying to address the problems raised in #50254
All of these points are addressed by this pull-request:
WrappedRoundTripper
interface.@smarterclayton @liggitt
Which issue this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close that issue when PR gets merged): fixes #50254Special notes for your reviewer:
Release note: