Repository navigation
[platform] fix deleting bundles - #809
Conversation
WalkthroughThe pull request introduces new steps to enhance deployment and resource management. In the Dockerfile, a command to install the Changes
Sequence Diagram(s)sequenceDiagram
participant S as Installer Script
participant R as Reconcile (Makefile)
participant A as Apply Target
participant D as Delete Target
S->>R: Run "make -C packages/core/platform reconcile"
R->>A: Execute "apply" target (filter via yq)
A-->>R: Return filtered HelmReleases
R->>D: Execute "delete" target (remove marked releases)
D-->>R: Return deletion results
R-->>S: Complete reconciliation
Poem
Tip ⚡💬 Agentic Chat (Pro Plan, General Availability)
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Signed-off-by: kklinch0 <[email protected]>
bb10773 to
f90fc6f
Compare
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (4)
packages/core/installer/images/cozystack/Dockerfile (1)
33-33: Added yq Installation Command
The new command installs theyqtool, which is essential for the new YAML filtering steps in the platform Makefile. To ensure consistent behavior across environments, consider pinning a specific version ofyqif determinism is important.packages/core/platform/Makefile (2)
10-14: Enhanced Apply Target with Filtering
The updatedapplytarget now echoes a debug message and pipes the Helm templated output throughyqto filter out resources marked for deletion. This approach is clear and practical. Just ensure that the filter expression reliably distinguishes resources you intend to manage.
15-20: New Delete Target Implementation
Thedeletetarget uses a similar pattern to identify and delete HelmReleases that have the annotationcozystack.io/marked-for-deletionset to"true". The inclusion of--ignore-not-found=truehelps avoid errors if no resources match. Consider adding some logging or error handling if deletion fails unexpectedly.packages/core/platform/templates/helmreleases.yaml (1)
83-101: New HelmRelease Resources for Disabled Components
This added section dynamically creates a HelmRelease for each disabled component by iterating over$disabledComponents. It correctly sets the annotationcozystack.io/marked-for-deletion: "true"and labels the resource appropriately, which integrates seamlessly with the Makefile's filtering logic.
A couple of points to consider:
- Verify that the lookup for the namespace via
index $dependencyNamespaces $name | default "cozy-system"always returns the desired value.- Adding an inline comment in the template explaining the purpose of this block could improve future maintainability.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
packages/core/installer/images/cozystack/Dockerfile(1 hunks)packages/core/platform/Makefile(1 hunks)packages/core/platform/templates/helmreleases.yaml(1 hunks)scripts/installer.sh(2 hunks)
🔇 Additional comments (3)
scripts/installer.sh (2)
73-73: Replaced 'apply' with 'reconcile' for Platform Chart Installation
The command has been updated to usemake -C packages/core/platform reconcile, ensuring that the deletion of marked HelmReleases is handled alongside applying active ones. This aligns well with the updated Makefile logic.
96-96: Reconcile Invocation in Continuous Loop
In the reconciliation loop, usingmake -C packages/core/platform reconcileinstead ofapplyensures both applying new changes and processing deletions. Please verify under load that the continuous reconciliation does not overwhelm the Kubernetes API.packages/core/platform/Makefile (1)
21-21: Consolidated Reconcile Target
By combining theapplyanddeletetargets intoreconcile, the Makefile now provides a single command that both applies active changes and cleans up outdated/deleted resources. This consolidation simplifies resource management.
Summary by CodeRabbit