Commit 94dc10b
committed
feat(kubewarden-controller): Delete all CRs in pre-delete hook
On 1.36, without this change:
- Deleting a PolicyServer sets its policies as scheduled.
- Recommended policies are managed via Helm and removed when
`kubewarden-defaults` is uninstalled.
- User-managed policies will never be deleted, and linger after
the removal of the CRDs, as they have finalizers.
With this change:
All CRs will be removed when uninstalling the `kubewarden-controller`
chart. This includes charts of downstream consumers that use a single
chart approach.
The used image, kuberlr/kubectl, has busybox, hence `ash` as shell.
Use the shell to remove all CRs. Removing all CRs in potentially all
namespaces is costly; do backgrounds jobs with `&`, wait, and only
then remove the policyservers.
Signed-off-by: Víctor Cuadrado Juan <vcuadradojuan@suse.de>1 parent 9ec623d commit 94dc10b
1 file changed
Lines changed: 10 additions & 1 deletion
Lines changed: 10 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
40 | 49 | | |
41 | 50 | | |
42 | 51 | | |
| |||
0 commit comments