Skip to content

Commit ca532c6

Browse files
committed
Ensure that error is returned on NodePublish
1 parent 4b8e552 commit ca532c6

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

pkg/kubelet/volumemanager/cache/actual_state_of_world.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424
"fmt"
2525
"sync"
2626

27-
"k8s.io/api/core/v1"
27+
v1 "k8s.io/api/core/v1"
2828
"k8s.io/apimachinery/pkg/types"
2929
utilfeature "k8s.io/apiserver/pkg/util/feature"
3030
"k8s.io/klog"
@@ -490,6 +490,7 @@ func (asw *actualStateOfWorld) AddPodToVolume(markVolumeOpts operationexecutor.M
490490

491491
// If pod exists, reset remountRequired value
492492
podObj.remountRequired = false
493+
podObj.volumeMountStateForPod = markVolumeOpts.VolumeMountState
493494
asw.attachedVolumes[volumeName].mountedPods[podName] = podObj
494495
return nil
495496
}

pkg/volume/csi/csi_client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ func (c *csiDriverClient) NodePublishVolume(
262262
if err != nil && !isFinalError(err) {
263263
return volumetypes.NewUncertainProgressError(err.Error())
264264
}
265-
return nil
265+
return err
266266
}
267267

268268
func (c *csiDriverClient) NodeExpandVolume(ctx context.Context, volumeID, volumePath string, newSize resource.Quantity) (resource.Quantity, error) {

pkg/volume/util/types/types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ func NewUncertainProgressError(msg string) *UncertainProgressError {
8282
}
8383

8484
// IsOperationFinishedError checks if given error is of type that indicates
85-
// operation is finished with an error.
85+
// operation is finished with a FINAL error.
8686
func IsOperationFinishedError(err error) bool {
8787
if _, ok := err.(*UncertainProgressError); ok {
8888
return false

0 commit comments

Comments
 (0)