Skip to content

Commit 3c50fb3

Browse files
committed
Not Returning Infeasible If Tags Were Modified
1 parent 7ede9a3 commit 3c50fb3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pkg/driver/controller_modify_volume.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,11 @@ func executeModifyVolumeRequest(c cloud.Cloud) func(string, modifyVolumeRequest)
151151
if err != nil {
152152
switch {
153153
case errors.Is(err, cloud.ErrInvalidArgument):
154+
// Returning Internal error instead of InvaliArgument because at this point any tag modifications have succeeded.
155+
// It would not be correct to return an error that is considered infeasible by the resizer if the volume was already modified in any way.
156+
if len(req.modifyTagsOptions.TagsToAdd) > 0 && len(req.modifyTagsOptions.TagsToDelete) > 0 {
157+
return 0, status.Errorf(codes.Internal, "Could not modify volume (invalid argument) %q: %v", volumeID, err)
158+
}
154159
return 0, status.Errorf(codes.InvalidArgument, "Could not modify volume (invalid argument) %q: %v", volumeID, err)
155160
case errors.Is(err, cloud.ErrNotFound):
156161
return 0, status.Errorf(codes.NotFound, "Could not modify volume (not found) %q: %v", volumeID, err)

0 commit comments

Comments
 (0)