Skip to content

Comments

operator: Delete HelmChart custom resource when HelmRelease is suspended#539

Merged
RafalKorepta merged 1 commit intorelease/v2.3.xfrom
rk/k8s-523/fix-flux-custom-resource-deletion
Mar 20, 2025
Merged

operator: Delete HelmChart custom resource when HelmRelease is suspended#539
RafalKorepta merged 1 commit intorelease/v2.3.xfrom
rk/k8s-523/fix-flux-custom-resource-deletion

Conversation

@RafalKorepta
Copy link
Contributor

@RafalKorepta RafalKorepta commented Mar 18, 2025

When Redpanda resource is migrated from using flux to defluxed mode the HelmRelease custom resource is put into suspend mode. That suspend mode can affect deletion process as HelmChart (a child resource that doesn't have ownerReference) is not fully reconciled by helmrelease_controller. Redpanda operator now try to delete HelmChart.

As unrelated problems with RBAC permission in integration test suite arised
RBAC in Redpanda resource is disabled.

Reference
https://github.com/fluxcd/helm-controller/blob/2d335f2aa0e2e0df2a631ebf19394aed07c556f3/internal/reconcile/helmchart_template.go#L163-L166 https://github.com/fluxcd/helm-controller/blob/2d335f2aa0e2e0df2a631ebf19394aed07c556f3/internal/controller/helmrelease_controller.go#L375-L388

Copy link
Contributor

@chrisseto chrisseto left a comment

Choose a reason for hiding this comment

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

Nice catch! Let's add a regression test?

@RafalKorepta RafalKorepta force-pushed the rk/k8s-523/fix-flux-custom-resource-deletion branch 3 times, most recently from 27cd51c to 97cf331 Compare March 19, 2025 19:28
@RafalKorepta RafalKorepta force-pushed the rk/k8s-523/fix-flux-custom-resource-deletion branch from 97cf331 to e50d5c2 Compare March 20, 2025 09:22
@RafalKorepta RafalKorepta force-pushed the rk/k8s-523/fix-flux-custom-resource-deletion branch from aa540c2 to e50d5c2 Compare March 20, 2025 11:22
@RafalKorepta RafalKorepta requested a review from chrisseto March 20, 2025 16:18
@RafalKorepta RafalKorepta force-pushed the rk/k8s-523/fix-flux-custom-resource-deletion branch from e50d5c2 to 9c33bd9 Compare March 20, 2025 17:09
When Redpanda resource is migrated from using flux to defluxed mode
the HelmRelease custom resource is put into suspend mode. That suspend mode
can affect deletion process as HelmChart (a child resource that doesn't have
ownerReference) is not fully reconciled by helmrelease_controller. Redpanda
operator now try to delete HelmChart.

As unrelated problems with RBAC permission in integration test suite arised
RBAC in Redpanda resource is disabled.

Reference
https://github.com/fluxcd/helm-controller/blob/2d335f2aa0e2e0df2a631ebf19394aed07c556f3/internal/reconcile/helmchart_template.go#L163-L166
https://github.com/fluxcd/helm-controller/blob/2d335f2aa0e2e0df2a631ebf19394aed07c556f3/internal/controller/helmrelease_controller.go#L375-L388
@RafalKorepta RafalKorepta force-pushed the rk/k8s-523/fix-flux-custom-resource-deletion branch from 9c33bd9 to 3f0f156 Compare March 20, 2025 17:10
@RafalKorepta RafalKorepta enabled auto-merge (rebase) March 20, 2025 18:04
@RafalKorepta RafalKorepta merged commit 9f01ceb into release/v2.3.x Mar 20, 2025
12 checks passed
@RafalKorepta RafalKorepta deleted the rk/k8s-523/fix-flux-custom-resource-deletion branch March 28, 2025 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants