kubernetes-sigs / aws-ebs-csi-driver

CSI driver for Amazon EBS https://aws.amazon.com/ebs/
Apache License 2.0
974 stars 787 forks source link

ModifyVolume should not modify PVC via VAC containing unsupported parameters #2099

Closed AndrewSirenko closed 1 month ago

AndrewSirenko commented 2 months ago

/kind bug

What happened?

When attempting Volume Modification via Volume Attribute Class (VAC), modifying my volume with no VAC to have the following VAC led to VolumeModifySuccessful, despite fakeParam not being a real mutable parameter for EBS Volumes.

apiVersion: storage.k8s.io/v1alpha1
kind: VolumeAttributesClass
metadata:
  name: io2-class
driverName: ebs.csi.aws.com
parameters:
  type: io2
  iops: "10000"
  fakeParam: "20"

What you expected to happen?

CSI Spec notes that INVALID_ARGUMENT gRPC error code must be returned when CO has specified mutable parameters not supported by the volume.

I would expect that mutable_parameter that EBS CSI Driver does not explicitly support should yield an INVALID_ARGUMENT error. This will be extra important to prevent fake volume modifications if EBS releases a elastic volume property that older versions of EBS CSI Driver do not actually use, because it would lead to volumes that were not actually modified.

How to reproduce it (as minimally and precisely as possible)?

Follow Volume Modification via Volume Attribute Class (VAC) example but with an edited volumeattributesclass.yaml

Anything else we need to know?:

Environment