VictoriaMetrics / VictoriaMetrics/operator

volumeAttributesClassName in volumeClaimTemplate is not applied to existing PVCs

Open
#2,598 1 comment 0 reactions 1 assignee View on GitHub

@vrutkovs is already working on this.

Since Sep 10, 2026.

Dominant language
Go
Stars
589
Forks
229
Avg merge
1d 9h
Merged PRs (30d)
77

Description

What happened

I set volumeAttributesClassName on vlstorage.storage.volumeClaimTemplate.spec in a VLCluster. The operator noticed the change and recreated the StatefulSet, and the new StatefulSet carries the field. The three existing PVCs were left as they were, so the volumes kept their original IOPS and throughput.

Operator v0.65.0, Kubernetes 1.36, aws-ebs-csi-driver v1.44.0.

What I expected

updateSTSPVC already lists the live PVCs and reconciles them against the template, so I expected the class name to be carried over the way a size change is.

Why it does not

modifyPVC in internal/controller/operator/factory/reconcile/statefulset_pvc_expand.go returns early when the storage request is unchanged, and Spec.Resources is the only spec field it ever writes.

Suggested change

Copy the field when it is set and differs:

vacChanged := newObj.Spec.VolumeAttributesClassName != nil &&
    !ptr.Equal(existingObj.Spec.VolumeAttributesClassName, newObj.Spec.VolumeAttributesClassName)

and let that count towards the early return. The nil check is needed because clearing the field is rejected once a class has taken effect.

Users who do not set the field are unaffected, since both sides stay nil and the comparison is false.

I am happy to open a PR if you would take it.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.