mirror of
https://github.com/kubernetes-sigs/descheduler.git
synced 2026-01-26 13:29:11 +01:00
feature: add PodsWithResourceClaims parameter in DefaultEvictorArgs PodProtections
Signed-off-by: googs1025 <googs1025@gmail.com>
This commit is contained in:
@@ -211,3 +211,17 @@ func evictionConstraintsForIgnorePodsWithoutPDB(ignorePodsWithoutPDB bool, handl
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func evictionConstraintsForResourceClaimsPods(protectionEnabled bool) []constraint {
|
||||
if protectionEnabled {
|
||||
return []constraint{
|
||||
func(pod *v1.Pod) error {
|
||||
if utils.IsPodWithResourceClaims(pod) {
|
||||
return fmt.Errorf("pod has ResourceClaims and descheduler is configured to protect ResourceClaims pods")
|
||||
}
|
||||
return nil
|
||||
},
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user