Skip to content
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 custom resource with negtive quantity #92

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

weiyuanke
Copy link

@weiyuanke weiyuanke commented Sep 28, 2023

@@ -139,6 +139,9 @@ func (r *Resource) SetCapacityToNode(node *corev1.Node) {
corev1.ResourceEphemeralStorage: empStorage,
}
for name, quota := range r.Custom {
if quota.Sign() < 0 {
continue
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure if add this logic will lead to some unexpected issues, e.g. evicting pods. Can you add some test for these scenes?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or, we can simply set the quantity to 0? since kubernetes cannot accept negtive values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Invalid value: "-20Gi": must be greater than or equal to 0
2 participants