Ensure that error is returned on NodePublish

This commit is contained in:
Hemant Kumar 2019-12-11 21:51:03 -05:00
parent 4b8e552a88
commit ca532c6fb2
3 changed files with 4 additions and 3 deletions

View File

@ -24,7 +24,7 @@ import (
"fmt"
"sync"
"k8s.io/api/core/v1"
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/types"
utilfeature "k8s.io/apiserver/pkg/util/feature"
"k8s.io/klog"
@ -490,6 +490,7 @@ func (asw *actualStateOfWorld) AddPodToVolume(markVolumeOpts operationexecutor.M
// If pod exists, reset remountRequired value
podObj.remountRequired = false
podObj.volumeMountStateForPod = markVolumeOpts.VolumeMountState
asw.attachedVolumes[volumeName].mountedPods[podName] = podObj
return nil
}

View File

@ -262,7 +262,7 @@ func (c *csiDriverClient) NodePublishVolume(
if err != nil && !isFinalError(err) {
return volumetypes.NewUncertainProgressError(err.Error())
}
return nil
return err
}
func (c *csiDriverClient) NodeExpandVolume(ctx context.Context, volumeID, volumePath string, newSize resource.Quantity) (resource.Quantity, error) {

View File

@ -82,7 +82,7 @@ func NewUncertainProgressError(msg string) *UncertainProgressError {
}
// IsOperationFinishedError checks if given error is of type that indicates
// operation is finished with an error.
// operation is finished with a FINAL error.
func IsOperationFinishedError(err error) bool {
if _, ok := err.(*UncertainProgressError); ok {
return false