mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-12 05:21:58 +00:00
Ensure that error is returned on NodePublish
This commit is contained in:
parent
4b8e552a88
commit
ca532c6fb2
@ -24,7 +24,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"k8s.io/api/core/v1"
|
v1 "k8s.io/api/core/v1"
|
||||||
"k8s.io/apimachinery/pkg/types"
|
"k8s.io/apimachinery/pkg/types"
|
||||||
utilfeature "k8s.io/apiserver/pkg/util/feature"
|
utilfeature "k8s.io/apiserver/pkg/util/feature"
|
||||||
"k8s.io/klog"
|
"k8s.io/klog"
|
||||||
@ -490,6 +490,7 @@ func (asw *actualStateOfWorld) AddPodToVolume(markVolumeOpts operationexecutor.M
|
|||||||
|
|
||||||
// If pod exists, reset remountRequired value
|
// If pod exists, reset remountRequired value
|
||||||
podObj.remountRequired = false
|
podObj.remountRequired = false
|
||||||
|
podObj.volumeMountStateForPod = markVolumeOpts.VolumeMountState
|
||||||
asw.attachedVolumes[volumeName].mountedPods[podName] = podObj
|
asw.attachedVolumes[volumeName].mountedPods[podName] = podObj
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -262,7 +262,7 @@ func (c *csiDriverClient) NodePublishVolume(
|
|||||||
if err != nil && !isFinalError(err) {
|
if err != nil && !isFinalError(err) {
|
||||||
return volumetypes.NewUncertainProgressError(err.Error())
|
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) {
|
func (c *csiDriverClient) NodeExpandVolume(ctx context.Context, volumeID, volumePath string, newSize resource.Quantity) (resource.Quantity, error) {
|
||||||
|
@ -82,7 +82,7 @@ func NewUncertainProgressError(msg string) *UncertainProgressError {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// IsOperationFinishedError checks if given error is of type that indicates
|
// 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 {
|
func IsOperationFinishedError(err error) bool {
|
||||||
if _, ok := err.(*UncertainProgressError); ok {
|
if _, ok := err.(*UncertainProgressError); ok {
|
||||||
return false
|
return false
|
||||||
|
Loading…
Reference in New Issue
Block a user