[Backport release-1.3] fix(backups): move velero-configmap Role to velero chart - #2467
Conversation
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>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Summary of ChangesHello, 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
🧠 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 AssistThe 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
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 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
|
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 | |||
There was a problem hiding this comment.
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
- 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 |
There was a problem hiding this comment.
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 |
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>
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>
Summary
Backport of #2459 to release-1.3.
Fixes installation failure of
backupstrategy-controllerin bundles without velero.Changes
Original Commit
Cherry-pick of c447725 from main.