docs(upgrade): add step to protect namespace before upgrading#435
Conversation
Add a required step to protect the cozy-system namespace and cozystack-version ConfigMap with helm.sh/resource-policy=keep annotation before upgrading. Without this, Helm could delete the namespace and all resources within it during release removal. Updated both the standard upgrade guide and the v0.41 to v1.0 migration guide. Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
✅ Deploy Preview for cozystack ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review infoConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughTwo upgrade documentation files were updated with new procedures: adding a critical resource protection step using Helm annotations before upgrades, expanding operator installation instructions with OCI-based helm commands, detailing migration script workflows, and enhancing verification steps with explicit validation commands. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
✨ 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 enhances the Cozystack upgrade documentation by integrating a crucial step to safeguard core Kubernetes resources. It ensures that the 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. Changelog
Activity
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-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. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request adds a critical step to the upgrade documentation to protect the cozy-system namespace and cozystack-version ConfigMap from being deleted by Helm during an upgrade. The changes are clear and well-explained in both the standard upgrade guide and the v0.41→v1.0 migration guide. I've suggested a small improvement to the provided commands to make them more robust, preventing potential failures if the cozystack-version ConfigMap doesn't exist in the user's environment. This will help avoid confusion during the upgrade process.
|
|
||
| ```bash | ||
| kubectl annotate namespace cozy-system helm.sh/resource-policy=keep --overwrite | ||
| kubectl annotate configmap -n cozy-system cozystack-version helm.sh/resource-policy=keep --overwrite |
There was a problem hiding this comment.
To improve the robustness of the upgrade script, it's a good practice to check for the existence of the cozystack-version ConfigMap before attempting to annotate it. This prevents the command from failing if the ConfigMap is not present, which could confuse users and halt their upgrade process. The suggested change wraps the annotation command in an if block that first verifies the ConfigMap exists.
| kubectl annotate configmap -n cozy-system cozystack-version helm.sh/resource-policy=keep --overwrite | |
| # Annotate the cozystack-version ConfigMap only if it exists | |
| if kubectl get configmap -n cozy-system cozystack-version >/dev/null 2>&1; then | |
| kubectl annotate configmap -n cozy-system cozystack-version helm.sh/resource-policy=keep --overwrite | |
| fi |
|
|
||
| ```bash | ||
| kubectl annotate namespace cozy-system helm.sh/resource-policy=keep --overwrite | ||
| kubectl annotate configmap -n cozy-system cozystack-version helm.sh/resource-policy=keep --overwrite |
There was a problem hiding this comment.
To make the upgrade steps more robust, it's better to check if the cozystack-version ConfigMap exists before trying to annotate it. This avoids a potential failure in the script if the ConfigMap is not found, which could cause confusion for the user. The suggested change adds a check for the ConfigMap's existence before running the kubectl annotate command.
| kubectl annotate configmap -n cozy-system cozystack-version helm.sh/resource-policy=keep --overwrite | |
| # Annotate the cozystack-version ConfigMap only if it exists | |
| if kubectl get configmap -n cozy-system cozystack-version >/dev/null 2>&1; then | |
| kubectl annotate configmap -n cozy-system cozystack-version helm.sh/resource-policy=keep --overwrite | |
| fi |
What this PR does
Adds a required step to both the standard upgrade guide and the v0.41→v1.0 migration guide:
annotate the
cozy-systemnamespace andcozystack-versionConfigMap withhelm.sh/resource-policy=keepbefore running helm upgrade.Without this annotation, Helm could delete the namespace and all resources within it
during release removal or upgrade.
Summary by CodeRabbit