...

Source file src/k8s.io/kubernetes/pkg/volume/noop_expandable_plugin.go

Documentation: k8s.io/kubernetes/pkg/volume

     1  /*
     2  Copyright 2018 The Kubernetes Authors.
     3  
     4  Licensed under the Apache License, Version 2.0 (the "License");
     5  you may not use this file except in compliance with the License.
     6  You may obtain a copy of the License at
     7  
     8      http://www.apache.org/licenses/LICENSE-2.0
     9  
    10  Unless required by applicable law or agreed to in writing, software
    11  distributed under the License is distributed on an "AS IS" BASIS,
    12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13  See the License for the specific language governing permissions and
    14  limitations under the License.
    15  */
    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