mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-21 01:26:28 +00:00
Use const in equiv class
This commit is contained in:
parent
f5ab6d5ad4
commit
c292af8f7b
@ -23,6 +23,7 @@ import (
|
|||||||
"k8s.io/api/core/v1"
|
"k8s.io/api/core/v1"
|
||||||
"k8s.io/apimachinery/pkg/util/sets"
|
"k8s.io/apimachinery/pkg/util/sets"
|
||||||
"k8s.io/kubernetes/pkg/scheduler/algorithm"
|
"k8s.io/kubernetes/pkg/scheduler/algorithm"
|
||||||
|
"k8s.io/kubernetes/pkg/scheduler/algorithm/predicates"
|
||||||
hashutil "k8s.io/kubernetes/pkg/util/hash"
|
hashutil "k8s.io/kubernetes/pkg/util/hash"
|
||||||
|
|
||||||
"github.com/golang/glog"
|
"github.com/golang/glog"
|
||||||
@ -188,21 +189,21 @@ func (ec *EquivalenceCache) InvalidateCachedPredicateItemForPodAdd(pod *v1.Pod,
|
|||||||
// it will also fits to equivalence class of existing pods
|
// it will also fits to equivalence class of existing pods
|
||||||
|
|
||||||
// GeneralPredicates: will always be affected by adding a new pod
|
// GeneralPredicates: will always be affected by adding a new pod
|
||||||
invalidPredicates := sets.NewString("GeneralPredicates")
|
invalidPredicates := sets.NewString(predicates.GeneralPred)
|
||||||
|
|
||||||
// MaxPDVolumeCountPredicate: we check the volumes of pod to make decision.
|
// MaxPDVolumeCountPredicate: we check the volumes of pod to make decision.
|
||||||
for _, vol := range pod.Spec.Volumes {
|
for _, vol := range pod.Spec.Volumes {
|
||||||
if vol.PersistentVolumeClaim != nil {
|
if vol.PersistentVolumeClaim != nil {
|
||||||
invalidPredicates.Insert("MaxEBSVolumeCount", "MaxGCEPDVolumeCount", "MaxAzureDiskVolumeCount")
|
invalidPredicates.Insert(predicates.MaxEBSVolumeCountPred, predicates.MaxGCEPDVolumeCountPred, predicates.MaxAzureDiskVolumeCountPred)
|
||||||
} else {
|
} else {
|
||||||
if vol.AWSElasticBlockStore != nil {
|
if vol.AWSElasticBlockStore != nil {
|
||||||
invalidPredicates.Insert("MaxEBSVolumeCount")
|
invalidPredicates.Insert(predicates.MaxEBSVolumeCountPred)
|
||||||
}
|
}
|
||||||
if vol.GCEPersistentDisk != nil {
|
if vol.GCEPersistentDisk != nil {
|
||||||
invalidPredicates.Insert("MaxGCEPDVolumeCount")
|
invalidPredicates.Insert(predicates.MaxGCEPDVolumeCountPred)
|
||||||
}
|
}
|
||||||
if vol.AzureDisk != nil {
|
if vol.AzureDisk != nil {
|
||||||
invalidPredicates.Insert("MaxAzureDiskVolumeCount")
|
invalidPredicates.Insert(predicates.MaxAzureDiskVolumeCountPred)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user