Skip to content

fix: propagate volume config from data paths to PVC template#51

Merged
rajsinghtech merged 2 commits intorajsinghtech:mainfrom
fredericrous:fix/data-pvc-volume-config-propagation
Feb 28, 2026
Merged

fix: propagate volume config from data paths to PVC template#51
rajsinghtech merged 2 commits intorajsinghtech:mainfrom
fredericrous:fix/data-pvc-volume-config-propagation

Conversation

@fredericrous
Copy link
Contributor

Summary

  • buildDataPVC now reads storageClassName, accessModes, and selector from paths[].volume when the top-level data fields are unset
  • Top-level Data.StorageClassName retains precedence over path-level config
  • Adds firstDataPathVolume helper to extract the first path's volume config as fallback
  • Matches existing buildMetadataPVC behavior which already propagates all three fields

Root Cause

When using storage.data.paths[], the operator generated a data volumeClaimTemplate without storageClassName, causing the cluster default to be used instead of the class specified in paths[].volume.storageClassName.

Test Plan

  • 7 new unit tests covering all propagation paths (storageClassName, accessModes, selector, precedence, edge cases)
  • All existing unit tests pass unchanged

Fixes #50

fredericrous and others added 2 commits February 28, 2026 09:04
…s to PVC

buildDataPVC only checked the top-level Data.StorageClassName and
ignored Paths[].Volume.StorageClassName, AccessModes, and Selector.
This caused data PVCs to use the cluster default StorageClass even
when a specific class was configured on the path volume.

Add firstDataPathVolume helper to extract volume config from the
first data path entry as a fallback when top-level fields are unset.
Top-level Data.StorageClassName retains precedence.

This matches the existing behavior of buildMetadataPVC which already
propagates all three fields from its VolumeConfig.

Fixes rajsinghtech#50
The string "fast-ssd" appeared 4 times across test files, triggering
the goconst lint rule. Extract it into a shared test constant.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@fredericrous fredericrous force-pushed the fix/data-pvc-volume-config-propagation branch from dfe89a8 to 012e79c Compare February 28, 2026 08:05
@rajsinghtech rajsinghtech merged commit 5dbe0ae into rajsinghtech:main Feb 28, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

buildDataPVC ignores paths[].volume.storageClassName, accessModes, selector

2 participants