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
helm uninstall #12968
Open
sjeandeaux
wants to merge
3
commits into
helm:main
Choose a base branch
from
sjeandeaux:helm-uninstall-dry-run
base: main
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
helm uninstall #12968
+18
−4
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pull-request-size
bot
added
the
size/S
Denotes a PR that changes 10-29 lines, ignoring generated files.
label
Apr 19, 2024
The goal is to have the same behaviour with or without dry-run with --ignore-not-found close helm#12970 Signed-off-by: Stephane Jeandeaux <stephane.jeandeaux@gmail.com>
sjeandeaux
force-pushed
the
helm-uninstall-dry-run
branch
from
April 23, 2024 12:29
688a605
to
4485702
Compare
eddymoulton
approved these changes
May 13, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully tested this locally with the below process.
The standard dry run output (without --ignore-not-found
) still differs from the regular output, but I'm happy that this PR fixes the issue it set out to fix.
helm install hello-world examples/hello-world
# Check behaviour is the same when a release exists
./bin/helm uninstall --dry-run --ignore-not-found hello-world
./bin/helm uninstall --ignore-not-found hello-world
# Check behaviour when the release doesn't exist (this change)
./bin/helm uninstall --dry-run --ignore-not-found hello-world
./bin/helm uninstall --ignore-not-found hello-world
# Check the behaviour without `--ignore-not-found`
./bin/helm uninstall --dry-run hello-world
./bin/helm uninstall hello-world
Before
➜ helm git:(main) helm install hello-world examples/hello-world
NAME: hello-world
LAST DEPLOYED: Mon May 13 14:20:38 2024
NAMESPACE: helm-12968
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
1. Get the application URL by running these commands:
export POD_NAME=$(kubectl get pods --namespace helm-12968 -l "app.kubernetes.io/name=hello-world,app.kubernetes.io/instance=hello-world" -o jsonpath="{.items[0].metadata.name}")
export CONTAINER_PORT=$(kubectl get pod --namespace helm-12968 $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
echo "Visit http://127.0.0.1:8080 to use your application"
kubectl --namespace helm-12968 port-forward $POD_NAME 8080:$CONTAINER_PORT
➜ helm git:(main) ./bin/helm uninstall --dry-run --ignore-not-found hello-world
release "hello-world" uninstalled
➜ helm git:(main) ./bin/helm uninstall --ignore-not-found hello-world
release "hello-world" uninstalled
➜ helm git:(main) ./bin/helm uninstall --dry-run --ignore-not-found hello-world
Error: release: not found
➜ helm git:(main) ./bin/helm uninstall --ignore-not-found hello-world
release "hello-world" uninstalled
➜ helm git:(main) ./bin/helm uninstall --dry-run hello-world
Error: release: not found
➜ helm git:(main) ./bin/helm uninstall hello-world
Error: uninstall: Release not loaded: hello-world: release: not found
After
➜ helm git:(helm-uninstall-dry-run) helm install hello-world examples/hello-world
NAME: hello-world
LAST DEPLOYED: Mon May 13 14:16:46 2024
NAMESPACE: helm-12968
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
1. Get the application URL by running these commands:
export POD_NAME=$(kubectl get pods --namespace helm-12968 -l "app.kubernetes.io/name=hello-world,app.kubernetes.io/instance=hello-world" -o jsonpath="{.items[0].metadata.name}")
export CONTAINER_PORT=$(kubectl get pod --namespace helm-12968 $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
echo "Visit http://127.0.0.1:8080 to use your application"
kubectl --namespace helm-12968 port-forward $POD_NAME 8080:$CONTAINER_PORT
➜ helm git:(helm-uninstall-dry-run) ./bin/helm uninstall --dry-run --ignore-not-found hello-world
release "hello-world" uninstalled
➜ helm git:(helm-uninstall-dry-run) ./bin/helm uninstall --ignore-not-found hello-world
release "hello-world" uninstalled
➜ helm git:(helm-uninstall-dry-run) ./bin/helm uninstall --dry-run --ignore-not-found hello-world
release "hello-world" uninstalled
➜ helm git:(helm-uninstall-dry-run) ./bin/helm uninstall --ignore-not-found hello-world
release "hello-world" uninstalled
➜ helm git:(helm-uninstall-dry-run) ./bin/helm uninstall --dry-run hello-world
Error: release: not found
➜ helm git:(helm-uninstall-dry-run) ./bin/helm uninstall hello-world
Error: uninstall: Release not loaded: hello-world: release: not found
Co-authored-by: Eddy Moulton <eddy@moulton.com.au> Signed-off-by: Stephane Jeandeaux <sjeandeaux@users.noreply.github.com>
Signed-off-by: Stephane Jeandeaux <stephane.jeandeaux@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
The goal is to have the same behaviour with or without dry-run with --ignore-not-found on uninstall.
I am developping a CD pipeline:
The fact is the pull request will be blocked due a failed build. The dry-run does not have the same behaviour.
Special notes for your reviewer:
If applicable:
refs #12970