-
Notifications
You must be signed in to change notification settings - Fork 724
refactor: separate eviction constraints to constraints.go #1693
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
refactor: separate eviction constraints to constraints.go #1693
Conversation
3bb2ec3
to
16a80b2
Compare
/assign @ingvagabund 😄 ptal |
16a80b2
to
a2f07a5
Compare
if priorityThreshold != nil && (priorityThreshold.Value != nil || len(priorityThreshold.Name) > 0) { | ||
thresholdPriority, err := utils.GetPriorityValueFromPriorityThreshold(context.TODO(), handle.ClientSet(), priorityThreshold) | ||
if err != nil { | ||
klog.Errorf("failed to get priority threshold: %v", 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.
This needs to return the error so it can be properly handled.
return nil | ||
} | ||
} | ||
return func(pod *v1.Pod) error { return nil } |
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.
This function will be a no-op and will be invoked every time a pod is checked for eviction. What about to
change the function signature to return []constraint
and return nil
instead?
return nil | ||
} | ||
} | ||
return func(pod *v1.Pod) error { return nil } |
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.
ditto
return nil | ||
} | ||
} | ||
return func(pod *v1.Pod) error { return nil } |
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.
ditto
} | ||
} | ||
} | ||
return func(pod *v1.Pod) error { return nil } |
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.
ditto
if labelSelector != nil { | ||
selector, err := metav1.LabelSelectorAsSelector(labelSelector) | ||
if err != nil { | ||
klog.Error(err, "could not get selector from label selector") |
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.
ditto
indexName := "metadata.ownerReferences" | ||
indexer, err := getPodIndexerByOwnerRefs(indexName, handle) | ||
if err != nil { | ||
klog.Error(err, "could not get pod indexer by ownerRefs") |
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.
ditto
return nil | ||
} | ||
} | ||
return func(pod *v1.Pod) error { return nil } |
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.
ditto
return nil | ||
} | ||
} | ||
return func(pod *v1.Pod) error { return nil } |
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.
ditto
return nil | ||
} | ||
} | ||
return func(pod *v1.Pod) error { return nil } |
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.
ditto
Signed-off-by: googs1025 <[email protected]>
6e79122
to
b3aeca7
Compare
/approve Thank you |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ingvagabund The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
constraints.go
more info base on: #1665 (review)