diff --git a/pkg/controllers/csi/driver/volumes/volume_config.go b/pkg/controllers/csi/driver/volumes/volume_config.go index 3426ec4b98..0b7cf6ee34 100644 --- a/pkg/controllers/csi/driver/volumes/volume_config.go +++ b/pkg/controllers/csi/driver/volumes/volume_config.go @@ -1,8 +1,6 @@ package csivolumes import ( - "time" - "github.com/container-storage-interface/spec/lib/go/csi" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -29,7 +27,6 @@ type VolumeConfig struct { PodName string Mode string DynakubeName string - RetryTimeout time.Duration } // Transforms the NodePublishVolumeRequest into a VolumeConfig @@ -76,16 +73,6 @@ func ParseNodePublishVolumeRequest(req *csi.NodePublishVolumeRequest) (*VolumeCo return nil, status.Error(codes.InvalidArgument, "No dynakube attribute included with request") } - retryTimeoutValue := volCtx[CSIVolumeAttributeRetryTimeout] - if retryTimeoutValue == "" { - return nil, status.Error(codes.InvalidArgument, "No retryTimeout attribute included with request") - } - - retryTimeout, err := time.ParseDuration(retryTimeoutValue) - if err != nil { - return nil, status.Error(codes.InvalidArgument, "The retryTimeout attribute has incorrect format") - } - return &VolumeConfig{ VolumeInfo: VolumeInfo{ VolumeID: volID, @@ -94,7 +81,6 @@ func ParseNodePublishVolumeRequest(req *csi.NodePublishVolumeRequest) (*VolumeCo PodName: podName, Mode: mode, DynakubeName: dynakubeName, - RetryTimeout: retryTimeout, }, nil } diff --git a/pkg/controllers/csi/driver/volumes/volume_config_test.go b/pkg/controllers/csi/driver/volumes/volume_config_test.go index 6c248d48d9..1b4dd6f60c 100644 --- a/pkg/controllers/csi/driver/volumes/volume_config_test.go +++ b/pkg/controllers/csi/driver/volumes/volume_config_test.go @@ -2,7 +2,6 @@ package csivolumes import ( "testing" - "time" "github.com/container-storage-interface/spec/lib/go/csi" "github.com/stretchr/testify/assert" @@ -142,47 +141,6 @@ func TestCSIDriverServer_ParsePublishVolumeRequest(t *testing.T) { require.Error(t, err) assert.Nil(t, volumeCfg) }) - t.Run(`retryTimeout missing from requests volume context`, func(t *testing.T) { - request := &csi.NodePublishVolumeRequest{ - VolumeCapability: &csi.VolumeCapability{ - AccessType: &csi.VolumeCapability_Mount{ - Mount: &csi.VolumeCapability_MountVolume{}, - }, - }, - VolumeId: testVolumeId, - TargetPath: testTargetPath, - VolumeContext: map[string]string{ - PodNameContextKey: testPodUID, - CSIVolumeAttributeDynakubeField: testDynakubeName, - CSIVolumeAttributeModeField: "test", - }, - } - volumeCfg, err := ParseNodePublishVolumeRequest(request) - - require.Error(t, err) - assert.Nil(t, volumeCfg) - }) - t.Run(`retryTimeout has incorrect format`, func(t *testing.T) { - request := &csi.NodePublishVolumeRequest{ - VolumeCapability: &csi.VolumeCapability{ - AccessType: &csi.VolumeCapability_Mount{ - Mount: &csi.VolumeCapability_MountVolume{}, - }, - }, - VolumeId: testVolumeId, - TargetPath: testTargetPath, - VolumeContext: map[string]string{ - PodNameContextKey: testPodUID, - CSIVolumeAttributeDynakubeField: testDynakubeName, - CSIVolumeAttributeModeField: "test", - CSIVolumeAttributeRetryTimeout: "5", - }, - } - volumeCfg, err := ParseNodePublishVolumeRequest(request) - - require.Error(t, err) - assert.Nil(t, volumeCfg) - }) t.Run(`request is parsed correctly`, func(t *testing.T) { request := &csi.NodePublishVolumeRequest{ VolumeCapability: &csi.VolumeCapability{ @@ -196,7 +154,6 @@ func TestCSIDriverServer_ParsePublishVolumeRequest(t *testing.T) { PodNameContextKey: testPodUID, CSIVolumeAttributeDynakubeField: testDynakubeName, CSIVolumeAttributeModeField: "test", - CSIVolumeAttributeRetryTimeout: "5m", }, } volumeCfg, err := ParseNodePublishVolumeRequest(request) @@ -208,6 +165,5 @@ func TestCSIDriverServer_ParsePublishVolumeRequest(t *testing.T) { assert.Equal(t, testPodUID, volumeCfg.PodName) assert.Equal(t, "test", volumeCfg.Mode) assert.Equal(t, testDynakubeName, volumeCfg.DynakubeName) - assert.Equal(t, time.Minute*5, volumeCfg.RetryTimeout) }) } diff --git a/pkg/controllers/dynakube/oneagent/daemonset/volumes.go b/pkg/controllers/dynakube/oneagent/daemonset/volumes.go index 029a292fc1..b10a51b9d8 100644 --- a/pkg/controllers/dynakube/oneagent/daemonset/volumes.go +++ b/pkg/controllers/dynakube/oneagent/daemonset/volumes.go @@ -141,7 +141,6 @@ func getCSIStorageVolume(dk *dynakube.DynaKube) corev1.Volume { VolumeAttributes: map[string]string{ csivolumes.CSIVolumeAttributeModeField: hostvolumes.Mode, csivolumes.CSIVolumeAttributeDynakubeField: dk.Name, - csivolumes.CSIVolumeAttributeRetryTimeout: dk.FeatureMaxCSIRetryTimeout().String(), }, }, },