...
1
16
17 package volume
18
19 import (
20 v1 "k8s.io/api/core/v1"
21 "k8s.io/apimachinery/pkg/api/resource"
22 "k8s.io/apimachinery/pkg/types"
23 )
24
25 type noopExpandableVolumePluginInstance struct {
26 spec *Spec
27 }
28
29 var _ ExpandableVolumePlugin = &noopExpandableVolumePluginInstance{}
30
31 func (n *noopExpandableVolumePluginInstance) ExpandVolumeDevice(spec *Spec, newSize resource.Quantity, oldSize resource.Quantity) (resource.Quantity, error) {
32 return newSize, nil
33 }
34
35 func (n *noopExpandableVolumePluginInstance) Init(host VolumeHost) error {
36 return nil
37 }
38
39 func (n *noopExpandableVolumePluginInstance) GetPluginName() string {
40 return n.spec.KubeletExpandablePluginName()
41 }
42
43 func (n *noopExpandableVolumePluginInstance) GetVolumeName(spec *Spec) (string, error) {
44 return n.spec.Name(), nil
45 }
46
47 func (n *noopExpandableVolumePluginInstance) CanSupport(spec *Spec) bool {
48 return true
49 }
50
51 func (n *noopExpandableVolumePluginInstance) RequiresRemount(spec *Spec) bool {
52 return false
53 }
54
55 func (n *noopExpandableVolumePluginInstance) NewMounter(spec *Spec, podRef *v1.Pod, opts VolumeOptions) (Mounter, error) {
56 return nil, nil
57 }
58
59 func (n *noopExpandableVolumePluginInstance) NewUnmounter(name string, podUID types.UID) (Unmounter, error) {
60 return nil, nil
61 }
62
63 func (n *noopExpandableVolumePluginInstance) ConstructVolumeSpec(volumeName, mountPath string) (ReconstructedVolume, error) {
64 return ReconstructedVolume{Spec: n.spec}, nil
65 }
66
67 func (n *noopExpandableVolumePluginInstance) SupportsMountOption() bool {
68 return true
69 }
70
71 func (n *noopExpandableVolumePluginInstance) SupportsBulkVolumeVerification() bool {
72 return false
73 }
74
75 func (n *noopExpandableVolumePluginInstance) RequiresFSResize() bool {
76 return true
77 }
78
79 func (n *noopExpandableVolumePluginInstance) SupportsSELinuxContextMount(spec *Spec) (bool, error) {
80 return false, nil
81 }
82
View as plain text