kube-scheduler remove non-csi volumelimit plugins

This commit is contained in:
carlory
2024-03-20 15:15:48 +08:00
parent 00236ae0d7
commit cba2b3f773
9 changed files with 52 additions and 1735 deletions

View File

@@ -24,9 +24,7 @@ import (
"k8s.io/apimachinery/pkg/util/sets"
utilfeature "k8s.io/apiserver/pkg/util/feature"
csilibplugins "k8s.io/csi-translation-lib/plugins"
v1helper "k8s.io/kubernetes/pkg/apis/core/v1/helper"
"k8s.io/kubernetes/pkg/features"
"k8s.io/kubernetes/pkg/scheduler/framework"
)
// isCSIMigrationOn returns a boolean value indicating whether
@@ -73,14 +71,3 @@ func isCSIMigrationOn(csiNode *storagev1.CSINode, pluginName string) bool {
return mpaSet.Has(pluginName)
}
// volumeLimits returns volume limits associated with the node.
func volumeLimits(n *framework.NodeInfo) map[v1.ResourceName]int64 {
volumeLimits := map[v1.ResourceName]int64{}
for k, v := range n.Allocatable.ScalarResources {
if v1helper.IsAttachableVolumeResourceName(k) {
volumeLimits[k] = v
}
}
return volumeLimits
}