-
Notifications
You must be signed in to change notification settings - Fork 712
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
Check if k8s resources are supported in runReflectorUntil
#3037
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rade
suggested changes
Jan 20, 2018
probe/kubernetes/client.go
Outdated
case "jobs": | ||
group = "batch/v1" | ||
default: | ||
return false, fmt.Errorf("Support check not available for resource %v", resource) |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
probe/kubernetes/client.go
Outdated
return store | ||
} | ||
|
||
// runReflectorUntil runs cache.Reflector#ListAndWatch in an endless loop. | ||
// Errors are logged and retried with exponential backoff. |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
rade
reviewed
Jan 20, 2018
probe/kubernetes/client.go
Outdated
@@ -24,6 +24,8 @@ import ( | |||
clientcmdapi "k8s.io/client-go/tools/clientcmd/api" | |||
) | |||
|
|||
const errResourceNotFound = "the server could not find the requested resource" |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
rbruggem
force-pushed
the
failed-to-connect-to-api
branch
from
January 22, 2018 13:44
5799039
to
fd31b15
Compare
`isResourceSupported` checks whether a kubernetes resource is supported by the api server. This ensures that, if the probe is unable to communicate with the api server, the call is retried until a true/false response. If `isResourceSupported` returns false, `ListAndWatch` is not called and `runReflectorUntil` just exits.
rbruggem
force-pushed
the
failed-to-connect-to-api
branch
from
January 22, 2018 13:47
fd31b15
to
2f9e2fc
Compare
rade
approved these changes
Jan 22, 2018
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.
Nice!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
isResourceSupported
checks whether a kubernetes resource is supported by the api server.This ensures that, if the probe is unable to communicate with the api server, the call is retried until a true/false response.
If
isResourceSupported
returns false,ListAndWatch
is not called andrunReflectorUntil
just exits.Fixes #3027.
Tested with kubernetes v1.3.0 and v1.8.0.