I want to add a condition in helm uninstall command in Azure devops pipeline if only a release(infra) is already there i want to uninstall it. How can i do that?
- task: HelmDeploy@0
displayName: Helm uninstall test
inputs:
connectionType: Kubernetes Service Connection
kubernetesServiceEndpoint: dev-test
command: uninstall
chartType: FilePath
chartPath: infra
waitForExecution: true
namespace: test
arguments: infra
continueOnError: true
You just need to pass --ignore-not-found option to helm uninstall command (see official docs).
Like this:
helm uninstall <MY_RELEASE_NAME> -n <MY_K8S-NAMESPACE> --ignore-not-found
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With