Skip to content

[Backport release-1.6] fix(apps): let the cleanup hooks watch the objects they delete - #4369

Merged
myasnikovdaniil merged 2 commits into
release-1.6from
backport-4135-to-release-1.6
Sep 23, 2026
Merged

myasnikovdaniil merged 2 commits into
release-1.6from
backport-4135-to-release-1.6

Conversation

@github-actions

Copy link
Copy Markdown

Description

Backport of #4135 to release-1.6.

@github-actions

Copy link
Copy Markdown
Author

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin backport-4135-to-release-1.6
git worktree add --checkout .worktree/backport-4135-to-release-1.6 backport-4135-to-release-1.6
cd .worktree/backport-4135-to-release-1.6
git reset --hard HEAD^
git cherry-pick -x 711fcc168c5976466b66ab9d3ac029891e5327e6 f886f26ad43d305849aa78e183d008f97b4bb82b
git push --force-with-lease

@coderabbitai

coderabbitai Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository: cozystack/cozystack/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: f1410838-44f0-491a-b1c0-42d57f49572f

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

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.

kubectl delete waits for the object to disappear unless told otherwise,
and that wait is a watch. The post-delete hook Roles of harbor,
clickhouse, mariadb and qdrant granted get, list and delete only, so
every uninstall logged a forbidden watch, the wait was skipped and the
hook reported success before the PVCs were actually gone.

The rules now carry watch for every resource the hooks delete, including
the named Secrets the mariadb hook removes.

Signed-off-by: Yan Bondarenko <[email protected]>
(cherry picked from commit 711fcc1)
Signed-off-by: Myasnikov Daniil <[email protected]>
Assisted-by: LLM
With watch granted, kubectl delete waits for the claims to be gone, and
its default for that wait is a week. A claim held by a pod that will not
stop, or a stuck detach, would hold the post-delete hook until
helm-controller's 300s uninstall budget ran out and leave the
HelmRelease stuck uninstalling.

The PVC deletes in the clickhouse, harbor, mariadb and qdrant hooks now
wait 120s at most and report the claims still terminating by name, and
each Job carries activeDeadlineSeconds 270 with a 10s termination grace
period, the numbers packages/apps/tenant/templates/cleanup-job.yaml
documents against that budget, so a kubectl that never returns cannot
hold the hook either.

The mariadb Role no longer grants watch on the named Secrets: they carry
no finalizer, so the delete never reaches the watch, and a resourceNames
rule does not authorize a collection watch anyway.

Signed-off-by: Yan Bondarenko <[email protected]>
Assisted-by: LLM
(cherry picked from commit f886f26)
Signed-off-by: Myasnikov Daniil <[email protected]>
@myasnikovdaniil
myasnikovdaniil force-pushed the backport-4135-to-release-1.6 branch from 2f38f46 to 6ec2e05 Compare September 23, 2026 10:27
@github-actions github-actions Bot added size/L This PR changes 100-499 lines, ignoring generated files area/release Issues or PRs related to release tooling (changelog, backport, release pipeline) kind/bug Categorizes issue or PR as related to a bug labels Sep 23, 2026
@myasnikovdaniil
myasnikovdaniil marked this pull request as ready for review September 23, 2026 12:03
@myasnikovdaniil
myasnikovdaniil merged commit d3a9a73 into release-1.6 Sep 23, 2026
15 checks passed
@myasnikovdaniil
myasnikovdaniil deleted the backport-4135-to-release-1.6 branch September 23, 2026 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/release Issues or PRs related to release tooling (changelog, backport, release pipeline) kind/bug Categorizes issue or PR as related to a bug size/L This PR changes 100-499 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants