Skip to content

Comments

Fix extraVolumes duplicate volumes key (#189) and existingVolumeClaim double-mount (#139)#196

Open
IQNeoXen wants to merge 1 commit intoguerzon:mainfrom
IQNeoXen:fix/extra-volumes-duplicate-key
Open

Fix extraVolumes duplicate volumes key (#189) and existingVolumeClaim double-mount (#139)#196
IQNeoXen wants to merge 1 commit intoguerzon:mainfrom
IQNeoXen:fix/extra-volumes-duplicate-key

Conversation

@IQNeoXen
Copy link

@IQNeoXen IQNeoXen commented Feb 20, 2026

Volume rendering was split across two templates: _podSpec.tpl emitted a volumes: block for existingVolumeClaim / extraVolumes, while deployment.yaml emitted a separate volumes: block for PVC-backed storage. When both storage.data and extraVolumes were set, the rendered manifest contained duplicate volumes: keys which resulted in invalid YAML that caused silent failures.

Similarly, the volumeMounts section used an exclusive if/else that only rendered extraVolumeMounts inside the existingVolumeClaim branch, skipping them entirely when storage.data was used.

Test Plan (also auto-generated by Opus):

  • helm lint passes (default values + branding values)
  • Default values: no volumes:/volumeMounts: rendered
  • storage.data only (Deployment + StatefulSet)
  • storage.data + storage.attachments (Deployment)
  • existingVolumeClaim only (Deployment + StatefulSet)
  • existingVolumeClaim + extraVolumes + extraVolumeMounts
  • storage.data + extraVolumes + extraVolumeMounts (the Volumes is defined twice for extraVolumes #189 bug scenario)
  • extraVolumes/extraVolumeMounts only, no storage
  • extraVolumeMounts only, no extraVolumes
  • extraVolumes only, no extraVolumeMounts
  • Full use case: storage.data + initContainer + ConfigMap + emptyDir

Caution

This fix was developed using Claude Code with Opus 4.6. Claude Code performed the root cause analysis across the Helm templates, implemented the fix, and ran the full test matrix against helm template and helm lint. All changes were reviewed and validated by me (@IQNeoXen) before submission though :)

Move all volume rendering out of _podSpec.tpl into deployment.yaml and
statefulset.yaml so that PVC volumes, existingVolumeClaim, and
extraVolumes are merged into a single volumes: block instead of
producing duplicate YAML keys.

Also fix extraVolumeMounts being ignored when storage.data is set
(guerzon#139) and remove the double-mount of /data/attachments from
existingVolumeClaim.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

Volumes is defined twice for extraVolumes Using storage.existingVolumeClaim in v0.31.1 can't find existing attachments.

1 participant