Skip to content

Commit

Permalink
Rename GrowPvc to ExpandVolume
Browse files Browse the repository at this point in the history
  • Loading branch information
gnufied committed Aug 31, 2017
1 parent 27fcb5e commit 6ccda81
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pkg/controller/volume/expand/sync_volume_resize.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func (rc *syncResize) Sync() {
glog.V(10).Infof("Operation for PVC %v is already pending", pvcWithResizeRequest.UniquePvcKey())
continue
}
growFuncError := rc.opsExecutor.GrowPvc(pvcWithResizeRequest, rc.resizeMap)
growFuncError := rc.opsExecutor.ExpandVolume(pvcWithResizeRequest, rc.resizeMap)
if growFuncError != nil {
glog.Errorf("Error growing pvc with %v", growFuncError)
}
Expand Down
6 changes: 3 additions & 3 deletions pkg/volume/util/operationexecutor/operation_executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ type OperationExecutor interface {
// IsOperationPending returns true if an operation for the given volumeName and podName is pending,
// otherwise it returns false
IsOperationPending(volumeName v1.UniqueVolumeName, podName volumetypes.UniquePodName) bool
// Grow PVC will grow size available to PVC
GrowPvc(*expandcache.PvcWithResizeRequest, expandcache.VolumeResizeMap) error
// Expand Volume will grow size available to PVC
ExpandVolume(*expandcache.PvcWithResizeRequest, expandcache.VolumeResizeMap) error
}

// NewOperationExecutor returns a new instance of OperationExecutor.
Expand Down Expand Up @@ -722,7 +722,7 @@ func (oe *operationExecutor) UnmountDevice(
deviceToDetach.VolumeName, "" /* podName */, unmountDeviceFunc, opCompleteFunc)
}

func (oe *operationExecutor) GrowPvc(pvcWithResizeRequest *expandcache.PvcWithResizeRequest, resizeMap expandcache.VolumeResizeMap) error {
func (oe *operationExecutor) ExpandVolume(pvcWithResizeRequest *expandcache.PvcWithResizeRequest, resizeMap expandcache.VolumeResizeMap) error {
expandFunc, err := oe.operationGenerator.GenerateExpandVolumeFunc(pvcWithResizeRequest, resizeMap)

if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions pkg/volume/util/operationexecutor/operation_generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -739,14 +739,14 @@ func (og *operationGenerator) GenerateExpandVolumeFunc(
return nil, fmt.Errorf("Error finding plugin for expanding volume: %q with error %v", pvcWithResizeRequest.QualifiedName(), err)
}

expanderPlugin, err := volumePlugin.NewExpander()
expanderPlugin, err := volumePlugin.NewExpander(pvcWithResizeRequest.VolumeSpec)

if err != nil {
return nil, fmt.Errorf("Error creating expander plugin for volume %q with error %v", pvcWithResizeRequest.QualifiedName(), err)
}

expandFunc := func() error {
expandErr := expanderPlugin.ExpandVolumeDevice(pvcWithResizeRequest.VolumeSpec, pvcWithResizeRequest.ExpectedSize, pvcWithResizeRequest.CurrentSize)
expandErr := expanderPlugin.ExpandVolumeDevice(pvcWithResizeRequest.ExpectedSize, pvcWithResizeRequest.CurrentSize)

if expandErr != nil {
glog.Errorf("Error expanding volume through cloudprovider for volume %q : %v", pvcWithResizeRequest.QualifiedName(), expandErr)
Expand Down

0 comments on commit 6ccda81

Please sign in to comment.