-
Notifications
You must be signed in to change notification settings - Fork 40.1k
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
Ignore error when discovering server supported groupVersions and resources #16082
Ignore error when discovering server supported groupVersions and resources #16082
Conversation
Labelling this PR as size/L |
GCE e2e test build/test passed for commit a998fc0f04af3d311a56d5cb1c3a41fdc2c8e193. |
cc @deads2k for negotiation awareness |
"k8s.io/kubernetes/pkg/runtime" | ||
) | ||
|
||
type JSONCodec 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.
I don't think we want this... why can't we use an existing codec for this? Any of them should be able to handle unversioned objects, right?
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.
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 don't have a strong opinion. If we find ourselves adding anything more complicated than straight json calls here, we should consider not using this.
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.
But consider changing the name to jsonCodec, and making a func NewCodec() jsonCodec {...}
so people can make one? Or a public variable var Codec = jsonCodec{}
.
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.
GCE e2e build/test failed for commit 273484d8eee631b5d991c2504e8bb3458cd63441. |
return nil, fmt.Errorf("unexpected error: %v", err) | ||
err = d.Get().AbsPath("/apis").Do().Into(apiGroupList) | ||
if err != nil { | ||
if !errors.IsNotFound(err) { |
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.
A secured 1.0 server could easily return a forbidden error here
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'm not familiar with the secured server
. Could you point me to the related code? Thanks.
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.
A server that limits users' access to URLs outside their namespace or specifically whitelisted exceptions (for 1.0, that would likely include /api
, but definitely wouldn't include /apis
. This is close to possible with the abac authorizer (#13097 is open to make it work completely), but real installations would be likely to deny requests outside the expected URL paths. TL;DR: either a NotFound or Forbidden error could easily be received for /apis
from a 1.0 installation.
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.
@deads2k I would actually be very tolerant of errors when requesting /apis
if we got a usable response from /api
, if we ever expect this to work against a 1.0 server
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.
Now it ignores 403 error as well.
Only minor comments, thanks. |
GCE e2e build/test failed for commit 36e55f6a19cd0456a6c82c5bb84e86b94bbeef8a. |
e2e failure:
|
@k8s-bot test this please. |
1 similar comment
@k8s-bot test this please. |
@k8s-bot test this please |
@k8s-bot test this |
@caesarxuchao the bot is currently dead, we're trying to revive it #16161. |
#16364 has been LGTMed. Thanks. |
Looks good, will put on the label when #16364 merges. |
@caesarxuchao can you make an issue for this, so we can track it for 1.1? Thanks |
Oh wait, you're occupied today-- I'll make one. |
Ignore 403 and 404 error when discovering server-supported group/version
92ccb9b
to
69932ae
Compare
@lavalamp rebased and squashed. I'll make a cherry-pick now. |
GCE e2e test build/test passed for commit 69932ae. |
Adding the lgtm label per #16082 (comment). @lavalamp please remove it if you want to. |
That's fine, thanks! |
@k8s-bot unit test this |
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
…#16082-upstream-release-1.1 Auto commit by PR queue bot
GCE e2e test build/test passed for commit 69932ae. |
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
GCE e2e test build/test passed for commit 69932ae. |
Automatic merge from submit-queue |
Auto commit by PR queue bot
…y-pick-of-#16082-upstream-release-1.1 Auto commit by PR queue bot
…y-pick-of-#16082-upstream-release-1.1 Auto commit by PR queue bot
First two commits are #15973.
Let the Discovery Client ignore error when discovering server supported groupVersions
fixes @bgrant0607's comment #15796 (comment).
This one needs to be cherry-picked.
supersede #16066
cc @liggitt @jlowdermilk