Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to uninstall helm release properly with cleanCRDs option enabled #520

Open
mimek opened this issue Nov 22, 2023 · 1 comment
Open
Labels

Comments

@mimek
Copy link

mimek commented Nov 22, 2023

What steps did you take and what happened:
Hello,
I'm using below valuefiles config which seems to be generating an issue:

snapshotsEnabled: true
cleanUpCRDs: true

configuration:
  volumeSnapshotLocation:
  - name: default
    provider: azure  
  - name: recovery
    provider: azure

After installing velero with that settings using latest helm-chart version (5.1.4) I'm having two volumeSnapshotsLocations created, defalt and recovery.

Now when I'm making uninstall of the release:

/usr/local/bin/helm3 /usr/local/bin/helm3 uninstall velero --namespace velero --wait --debug
uninstall.go:102: [debug] uninstall: Deleting velero
client.go:142: [debug] creating 1 resource(s)
client.go:712: [debug] Watching for changes to Job velero-cleanup-crds with timeout of 5m0s
client.go:740: [debug] Add/Modify event for velero-cleanup-crds: ADDED
client.go:779: [debug] velero-cleanup-crds: Jobs active: 0, jobs failed: 0, jobs succeeded: 0
client.go:740: [debug] Add/Modify event for velero-cleanup-crds: MODIFIED
client.go:779: [debug] velero-cleanup-crds: Jobs active: 1, jobs failed: 0, jobs succeeded: 0
client.go:740: [debug] Add/Modify event for velero-cleanup-crds: MODIFIED
client.go:779: [debug] velero-cleanup-crds: Jobs active: 1, jobs failed: 0, jobs succeeded: 0
client.go:740: [debug] Add/Modify event for velero-cleanup-crds: MODIFIED
client.go:779: [debug] velero-cleanup-crds: Jobs active: 1, jobs failed: 0, jobs succeeded: 0
client.go:740: [debug] Add/Modify event for velero-cleanup-crds: MODIFIED
client.go:779: [debug] velero-cleanup-crds: Jobs active: 0, jobs failed: 0, jobs succeeded: 0
client.go:740: [debug] Add/Modify event for velero-cleanup-crds: MODIFIED
client.go:486: [debug] Starting delete for "velero-cleanup-crds" Job
uninstall.go:124: [debug] uninstall: Failed to delete release: [unable to build kubernetes objects for delete: [resource mapping not found for name: "default" namespace: "velero" from "": no matches for kind "VolumeSnapshotLocation" in version "velero.io/v1"
ensure CRDs are installed first, resource mapping not found for name: "recovery" namespace: "velero" from "": no matches for kind "VolumeSnapshotLocation" in version "velero.io/v1"
ensure CRDs are installed first]]
Error: failed to delete release: velero
helm.go:84: [debug] failed to delete release: velero
helm.sh/helm/v3/pkg/action.(*Uninstall).Run
        helm.sh/helm/v3/pkg/action/uninstall.go:125
main.newUninstallCmd.func2
        helm.sh/helm/v3/cmd/helm/uninstall.go:60
github.com/spf13/cobra.(*Command).execute
        github.com/spf13/cobra@v1.7.0/command.go:940
github.com/spf13/cobra.(*Command).ExecuteC
        github.com/spf13/cobra@v1.7.0/command.go:1068
github.com/spf13/cobra.(*Command).Execute
        github.com/spf13/cobra@v1.7.0/command.go:992
main.main
        helm.sh/helm/v3/cmd/helm/helm.go:83
runtime.main
        runtime/proc.go:250
runtime.goexit
        runtime/asm_amd64.s:1598

It seems for me the CRD of VolumeSnapshotLocation is being removed before helm wants to remove volumesnapshots CRs. If I re-add helm-hooks in volumeSnapshotLocation CRD which were removed in helm-chart version 5.x it uninstalls properly.

What did you expect to happen:
Uninstall should be working properly when cleanupCRDS is enabled.

The output of the following commands will help us better understand what's going on:
(Pasting long output into a GitHub gist or other pastebin is fine.)

Anything else you would like to add:
[Miscellaneous information that will assist in solving the issue.]

Environment:

  • helm version (use helm version): 3.13.2
  • helm chart version and app version (use helm list -n <YOUR NAMESPACE>): 5.1.4
  • Kubernetes version (use kubectl version): 1.28.2
  • Kubernetes installer & version:
  • Cloud provider or hardware configuration:
  • OS (e.g. from /etc/os-release):
@jenting jenting added the velero label Nov 24, 2023
@angelAtSequent
Copy link

Im in the same page!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants