@@ -263,32 +263,6 @@ type NodeExpandableVolumePlugin interface {
263
263
NodeExpand (resizeOptions NodeResizeOptions ) (bool , error )
264
264
}
265
265
266
- // VolumePluginWithAttachLimits is an extended interface of VolumePlugin that restricts number of
267
- // volumes that can be attached to a node.
268
- type VolumePluginWithAttachLimits interface {
269
- VolumePlugin
270
- // Return maximum number of volumes that can be attached to a node for this plugin.
271
- // The key must be same as string returned by VolumeLimitKey function. The returned
272
- // map may look like:
273
- // - { "storage-limits-aws-ebs": 39 }
274
- // - { "storage-limits-gce-pd": 10 }
275
- // A volume plugin may return error from this function - if it can not be used on a given node or not
276
- // applicable in given environment (where environment could be cloudprovider or any other dependency)
277
- // For example - calling this function for EBS volume plugin on a GCE node should
278
- // result in error.
279
- // The returned values are stored in node allocatable property and will be used
280
- // by scheduler to determine how many pods with volumes can be scheduled on given node.
281
- GetVolumeLimits () (map [string ]int64 , error )
282
- // Return volume limit key string to be used in node capacity constraints
283
- // The key must start with prefix storage-limits-. For example:
284
- // - storage-limits-aws-ebs
285
- // - storage-limits-csi-cinder
286
- // The key should respect character limit of ResourceName type
287
- // This function may be called by kubelet or scheduler to identify node allocatable property
288
- // which stores volumes limits.
289
- VolumeLimitKey (spec * Spec ) string
290
- }
291
-
292
266
// BlockVolumePlugin is an extend interface of VolumePlugin and is used for block volumes support.
293
267
type BlockVolumePlugin interface {
294
268
VolumePlugin
@@ -751,20 +725,6 @@ func (pm *VolumePluginMgr) refreshProbedPlugins() {
751
725
}
752
726
}
753
727
754
- // ListVolumePluginWithLimits returns plugins that have volume limits on nodes
755
- func (pm * VolumePluginMgr ) ListVolumePluginWithLimits () []VolumePluginWithAttachLimits {
756
- pm .mutex .RLock ()
757
- defer pm .mutex .RUnlock ()
758
-
759
- matchedPlugins := []VolumePluginWithAttachLimits {}
760
- for _ , v := range pm .plugins {
761
- if plugin , ok := v .(VolumePluginWithAttachLimits ); ok {
762
- matchedPlugins = append (matchedPlugins , plugin )
763
- }
764
- }
765
- return matchedPlugins
766
- }
767
-
768
728
// FindPersistentPluginBySpec looks for a persistent volume plugin that can
769
729
// support a given volume specification. If no plugin is found, return an
770
730
// error
@@ -779,20 +739,6 @@ func (pm *VolumePluginMgr) FindPersistentPluginBySpec(spec *Spec) (PersistentVol
779
739
return nil , fmt .Errorf ("no persistent volume plugin matched" )
780
740
}
781
741
782
- // FindVolumePluginWithLimitsBySpec returns volume plugin that has a limit on how many
783
- // of them can be attached to a node
784
- func (pm * VolumePluginMgr ) FindVolumePluginWithLimitsBySpec (spec * Spec ) (VolumePluginWithAttachLimits , error ) {
785
- volumePlugin , err := pm .FindPluginBySpec (spec )
786
- if err != nil {
787
- return nil , fmt .Errorf ("could not find volume plugin for spec : %#v" , spec )
788
- }
789
-
790
- if limitedPlugin , ok := volumePlugin .(VolumePluginWithAttachLimits ); ok {
791
- return limitedPlugin , nil
792
- }
793
- return nil , fmt .Errorf ("no plugin with limits found" )
794
- }
795
-
796
742
// FindPersistentPluginByName fetches a persistent volume plugin by name. If
797
743
// no plugin is found, returns error.
798
744
func (pm * VolumePluginMgr ) FindPersistentPluginByName (name string ) (PersistentVolumePlugin , error ) {
0 commit comments