Skip to content

[Backport release-1.3] fix(backups): move velero-configmap Role to velero chart - #2467

Merged
myasnikovdaniil merged 1 commit into
release-1.3from
backport/fix-backups-velero-configmap-to-1.3
Apr 23, 2026
Merged

[Backport release-1.3] fix(backups): move velero-configmap Role to velero chart#2467
myasnikovdaniil merged 1 commit into
release-1.3from
backport/fix-backups-velero-configmap-to-1.3

Conversation

@IvanHunters

Copy link
Copy Markdown
Collaborator

Summary

Backport of #2459 to release-1.3.

Fixes installation failure of backupstrategy-controller in bundles without velero.

Changes

  • Move velero-configmap Role/RoleBinding from backupstrategy-controller chart to velero chart
  • Prevents "namespaces "cozy-velero" not found" error when velero is not installed

Original Commit

Cherry-pick of c447725 from main.

The backupstrategy-controller chart declared a Role/RoleBinding in the
cozy-velero namespace for ResourceModifier ConfigMap management. Because
velero is an optional package, that namespace does not exist in bundles
without velero, so Helm install aborted with "namespaces \"cozy-velero\"
not found" and blocked the default install of backupstrategy-controller.

Move the Role and RoleBinding into the velero chart so they are created
only when velero is actually installed. The RoleBinding subject points
to the backupstrategy-controller ServiceAccount in its fixed namespace
(cozy-backup-controller).

Assisted-By: Claude <noreply@anthropic.com>
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
@coderabbitai

coderabbitai Bot commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: c074a55d-5df0-4023-8116-343281f89a84

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch backport/fix-backups-velero-configmap-to-1.3

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@dosubot dosubot Bot added the size/XS This PR changes 0-9 lines, ignoring generated files label Apr 23, 2026
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request backports a fix to ensure the backupstrategy-controller installs correctly in environments without Velero. By relocating the Velero-specific RBAC resources to the Velero chart, the controller no longer attempts to create objects in a missing namespace, thereby preventing deployment errors.

Highlights

  • RBAC Migration: Moved the Role and RoleBinding for velero-configmaps from the backupstrategy-controller chart to the velero chart.
  • Installation Fix: Resolved installation failures in environments where Velero is not present by preventing the creation of resources in non-existent namespaces.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment Gemini (@gemini-code-assist) Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on Gemini (@gemini-code-assist) comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@dosubot dosubot Bot added the kind/bug Categorizes issue or PR as related to a bug label Apr 23, 2026
@myasnikovdaniil myasnikovdaniil changed the title fix(backups): move velero-configmap Role to velero chart [Backport release-1.3] fix(backups): move velero-configmap Role to velero chart Apr 23, 2026
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Apr 23, 2026
@myasnikovdaniil
myasnikovdaniil merged commit 41bcb0b into release-1.3 Apr 23, 2026
12 checks passed
@myasnikovdaniil
myasnikovdaniil deleted the backport/fix-backups-velero-configmap-to-1.3 branch April 23, 2026 12:08

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request moves the RBAC Role and RoleBinding for the backupstrategy-controller from its own package to the velero package to ensure these resources are only created when Velero is installed. Feedback identifies a potential error in the hardcoded namespace for the ServiceAccount, which may lead to permission failures. Additionally, there are recommendations to explicitly define namespaces in the Helm templates for consistency and clarity. Finally, the PR title and release-note block were flagged for violating the repository's style guide regarding conventional commits and documentation requirements.

subjects:
- kind: ServiceAccount
name: backupstrategy-controller
namespace: cozy-backup-controller

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The namespace cozy-backup-controller is hardcoded and appears to be incorrect. In Cozystack, the backup-related controllers are typically installed in the cozy-backups namespace. If the backupstrategy-controller ServiceAccount is located in a different namespace, this RoleBinding will fail to grant the necessary permissions. Please verify the correct namespace name.

@@ -10,17 +10,3 @@ subjects:
- kind: ServiceAccount

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

low

The PR title uses the scope backups, which does not match a valid package name (e.g., backupstrategy-controller or velero) or a predefined scope. Additionally, the release-note block in the PR description is a placeholder and should be updated with a descriptive entry.

References
  1. Commits must follow Conventional Commits format with valid scopes, and the PR body must contain a non-placeholder release-note block. (link)

apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: backups.cozystack.io:strategy-controller:velero-configmaps

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

low

It is recommended to explicitly set the namespace in the metadata to {{ .Release.Namespace }}. This ensures the Role is created in the Velero installation namespace, maintaining consistency with the previous implementation and improving clarity.

  name: backups.cozystack.io:strategy-controller:velero-configmaps
  namespace: {{ .Release.Namespace }}

apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: backups.cozystack.io:strategy-controller:velero-configmaps

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

low

Explicitly defining the namespace in the RoleBinding metadata is recommended for consistency with the Role definition above.

  name: backups.cozystack.io:strategy-controller:velero-configmaps
  namespace: {{ .Release.Namespace }}

myasnikovdaniil added a commit that referenced this pull request Apr 29, 2026
The AI-generated v1.3.1 changelog (#2480) was generated from
git log v1.3.0..main rather than git log v1.3.0..v1.3.1, because
the workflow checked out main while the v1.3.1 tag points to
release-1.3. As a result the changelog included:

- 8 PRs that were merged to main but never shipped in v1.3.1
- 6 backport PRs that were merged to release-1.3 *after* v1.3.1
  was tagged
- Both originals and their backports as separate duplicate entries
- A 2024 PR (#435) that has nothing to do with this range
- Generic "Documentation updates" placeholders for website entries
- Title duplicated as both the bold label and the description
  (`* **fix(...): X**: fix(...): X (...)`)
- The cozystack-ci bot listed as a human contributor

The actual v1.3.1 release range (v1.3.0..v1.3.1) contains exactly
one user-facing change:

  41bcb0b [Backport release-1.3] fix(backups): move
           velero-configmap Role to velero chart (#2467)

which is the backport of #2459 (myasnikovdaniil) shipped via
#2467 (IvanHunters). This commit replaces the contents of
docs/changelogs/v1.3.1.md with that one entry, the matching
two-person contributors list, and the standard footer.

The workflow + docs fixes that prevent this regression for future
patch releases will land in a separate PR against main.

Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
myasnikovdaniil added a commit that referenced this pull request Apr 29, 2026
The auto-generated changelog only listed #2459/#2467 (velero-configmap
Role move). Five additional PRs were backported and merged into
release-1.3 between then and the v1.3.1 tag (2026-04-28):

- #2471/#2524 - fix(api): IDOR in TenantNamespace Get/Watch
- #2496/#2505 - feat(linstor): linstor-csi v1.10.6 (Protocol-C dual-attach)
- #2462/#2511 - fix(etcd): remove destructive post-upgrade hook
- #2421/#2491 - fix(kamaji): memory limits + startup probe
- #2498/#2518 - build(linstor): wire linstor-gui into root build target

Update the release date to match the actual tag (2026-04-28), rewrite
the intro paragraph, and add @kvaps to contributors.

Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Categorizes issue or PR as related to a bug lgtm This PR has been approved by a maintainer size/XS This PR changes 0-9 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants