-
Notifications
You must be signed in to change notification settings - Fork 3.3k
fixing listing nodes #1739
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
Closed
Closed
fixing listing nodes #1739
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -214,12 +214,13 @@ def type(self, type): | |
""" | ||
if self.local_vars_configuration.client_side_validation and type is None: # noqa: E501 | ||
raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 | ||
allowed_values = ["DiskPressure", "MemoryPressure", "NetworkUnavailable", "PIDPressure", "Ready"] # noqa: E501 | ||
allowed_values = ["DiskPressure", "MemoryPressure", "NetworkUnavailable", "PIDPressure", "Ready", "TerminateScheduled", "PreemptScheduled", "FreezeScheduled", "RebootScheduled", "FrequentContainerdRestart", "RedeployScheduled", "ReadonlyFilesystem", "FrequentKubeletRestart", "ContainerRuntimeProblem", "FilesystemCorruptionProblem", "FrequentDockerRestart", "KubeletProblem", "KernelDeadlock","FrequentUnregisterNetDevice"] # noqa: E501 | ||
if self.local_vars_configuration.client_side_validation and type not in allowed_values: # noqa: E501 | ||
raise ValueError( | ||
"Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 | ||
.format(type, allowed_values) | ||
) | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: stray edit. |
||
|
||
self._type = type | ||
|
||
|
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.
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 think this needs to be fixed in the upstream kubernetes. This client is generated from Kubernetes OpenAPI spec, and according to the spec:
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.
@roycaihw you reckon we should make a PR over there? any guidelines on where should we add 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.
Yes, I'm afraid we should remove this line.
kubernetes/kubernetes#105057 made the openapi-generated clients do more strict validation for this enum. However, according to #1735 it seems common for cloud providers (e.g. GKE, AKS) to expend the possible values for this enum-- which won't pass the client-side validation.
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.
In the meantime, I think we can accept a hot patch to remove this client-side validation. It seems pretty bad that the client will randomly fail listing nodes when talking to a cloud provider.
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 think we should treat this field to be not an enum. I will send a PR shortly.