Skip to content

feat: override operator emptyDir volumes with generic ephemeral volumes - #1404

Open
nikitapal-12 wants to merge 1 commit into
redhat-developer:masterfrom
nikitapal-12:rfe-10018-generic-ephemeral-volumes
Open

nikitapal-12 wants to merge 1 commit into
redhat-developer:masterfrom
nikitapal-12:rfe-10018-generic-ephemeral-volumes

Conversation

@nikitapal-12

Copy link
Copy Markdown

What does this PR do?

Operator-managed emptyDir volumes always consume node-local ephemeral storage. A user volume with the same name now replaces that volume, so administrators can supply a Generic Ephemeral Volume (ephemeral.volumeClaimTemplate) instead. emptyDir remains the default, and volumes with new names are still appended.

This applies to the repo server, application controller, ApplicationSet controller, server, Dex, Redis, Redis HA proxy, commit server, and image updater. Redis, the image updater, and the commit server gain a volumes field so their internal emptyDir volumes can be overridden the same way.

https://redhat.atlassian.net/browse/RFE-10018

PR acceptance criteria:

  • Documentation was updated and verified using make serve-docs
  • Unit tests were updated
  • E2E tests were updated

Documentation and e2e coverage are not part of this change. Unit tests cover volume replacement and the repo-server ephemeral override.

What type of PR is this?

/kind enhancement

Special notes to the reviewer:

A volume whose name matches an operator-managed volume replaces it, and operator volume order is preserved. To verify, set spec.repo.volumes to an ephemeral.volumeClaimTemplate volume named var-files (or gpg-keyring, plugins, or tmp) and confirm the repo-server pod has a single volume of that name using the ephemeral source.

Administrators cannot replace the operator-managed emptyDir volumes, so
temporary Argo CD data always consumes node-local ephemeral storage. A
user volume with the same name now replaces that volume, including a
Generic Ephemeral Volume (ephemeral.volumeClaimTemplate). emptyDir stays
the default.

Redis, the image updater, and the commit server accept volumes so their
internal emptyDir volumes can be overridden the same way.

RFE-10018

Signed-off-by: Nikita Pal <npal@redhat.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@openshift-ci openshift-ci Bot added the kind/enhancement New feature or request label Oct 15, 2026
@openshift-ci
openshift-ci Bot requested a review from anandrkskd October 15, 2026 05:03
@openshift-ci

openshift-ci Bot commented Oct 15, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign jgwest for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci

openshift-ci Bot commented Oct 15, 2026

Copy link
Copy Markdown

Hi @nikitapal-12. Thanks for your PR.

I'm waiting for a redhat-developer member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@coderabbitai

coderabbitai Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository YAML (base), Organization UI (inherited)
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f63009c9-d77b-4850-a255-a5e3f1fee0b0
📥 Commits

Reviewing files that changed from the base of the PR and between d86d915 and 5a5c1ba.

📒 Files selected for processing: 16
  • argocd-operator/api/v1alpha1/argocd_types.go
  • argocd-operator/api/v1alpha1/zz_generated.deepcopy.go
  • argocd-operator/api/v1beta1/argocd_types.go
  • argocd-operator/api/v1beta1/zz_generated.deepcopy.go
  • argocd-operator/controllers/argocd/applicationset.go
  • argocd-operator/controllers/argocd/commitserver.go
  • argocd-operator/controllers/argocd/deployment.go
  • argocd-operator/controllers/argocd/deployment_test.go
  • argocd-operator/controllers/argocd/dex.go
  • argocd-operator/controllers/argocd/image_updater.go
  • argocd-operator/controllers/argocd/repo_server.go
  • argocd-operator/controllers/argocd/statefulset.go
  • argocd-operator/controllers/argocd/volumes.go
  • argocd-operator/controllers/argocd/volumes_test.go
  • bundle/manifests/argoproj.io_argocds.yaml
  • config/crd/bases/argoproj.io_argocds.yaml
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

📝 Summary

Summary by CodeRabbit

  • New Features
    • Custom volumes can now be configured for additional Argo CD components, including the commit server, Image Updater, and Redis.
    • Custom volumes with the same name as operator-managed volumes now replace them, while other custom volumes are added. This supports replacing managed emptyDir volumes with Generic Ephemeral Volumes.

The operator API adds volume fields for Commit Server, Image Updater, and Redis. A shared merge helper replaces same-named operator volumes with user-provided volumes and appends unmatched volumes. Deployment and StatefulSet reconciliation paths now use this helper.

Changes: Volume Overrides

Layer / File(s) Summary
Volume API fields and copy behavior
argocd-operator/api/v1alpha1/argocd_types.go, argocd-operator/api/v1alpha1/zz_generated.deepcopy.go, argocd-operator/api/v1beta1/argocd_types.go, argocd-operator/api/v1beta1/zz_generated.deepcopy.go
Commit Server, Image Updater, and Redis specs add volume fields. Their deep-copy methods copy the volume slices. Volume comments document same-name replacement of operator-managed volumes.
Name-based volume merge
argocd-operator/controllers/argocd/volumes.go, argocd-operator/controllers/argocd/volumes_test.go
mergeOperatorVolumes replaces same-named operator volumes and appends unmatched user volumes. Tests cover empty input, replacement, and duplicate names.
Deployment volume reconciliation
argocd-operator/controllers/argocd/applicationset.go, argocd-operator/controllers/argocd/commitserver.go, argocd-operator/controllers/argocd/deployment.go, argocd-operator/controllers/argocd/deployment_test.go, argocd-operator/controllers/argocd/dex.go, argocd-operator/controllers/argocd/image_updater.go, argocd-operator/controllers/argocd/repo_server.go, argocd-operator/controllers/argocd/statefulset.go
Deployment and StatefulSet reconciliation paths use the merge helper for component volumes. A repo-server test checks that a user-provided Generic Ephemeral Volume replaces the managed var-files EmptyDir.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant ArgoCDCustomResource
  participant DeploymentReconciler
  participant mergeOperatorVolumes
  participant DesiredDeployment
  ArgoCDCustomResource->>DeploymentReconciler: provide component volume specs
  DeploymentReconciler->>mergeOperatorVolumes: combine operator and user volumes
  mergeOperatorVolumes-->>DeploymentReconciler: merged volume list
  DeploymentReconciler->>DesiredDeployment: set desired volumes
Loading

Suggested reviewers: olivergondza

Merge Risk: ⚪ Minimal · up to 5a5c1

The volume overrides appear ready to merge after normal checks. The shipped schemas support the new fields, and the v1alpha1 Commit Server override survives conversion.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 14 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: allowing user-provided Generic Ephemeral Volumes to replace operator-managed emptyDir volumes.
Description check Passed The description accurately explains volume replacement behavior, affected components, added fields, and test coverage. It is directly related to the changeset.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant