33 Commits

Author SHA1 Message Date
Hidde Beydals
8bb0b37226 fix(uninstall): supersede deployed releases
This ensures that when `helm uninstall` is run with `--keep-history`
any release in a `deployed` state other than the last release (e.g.
due to a failed upgrade) is being marked as `superseded`.

As a by-effect, running `helm upgrade` on a release which has been
uninstalled after an upgrade failure now no longer works. But instead
fails with a `"<name>" has no deployed releases` error. Which is the
(likely) intended behavior, and prevents other side-effects like
rolling back to a release version which happened before the uninstall
if `--atomic` (or `--rollback-on-failure`) was provided.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
(cherry picked from commit 2f1ecc7100)
2025-12-13 19:51:20 +01:00
Marcin Owsiany
a6863a64ce Drop unused field.
Signed-off-by: Marcin Owsiany <porridge@redhat.com>
2024-04-04 11:14:23 +02:00
satoru
5b08985138 goimports
Signed-off-by: satoru <satorulogic@gmail.com>
2023-08-09 13:52:45 +08:00
suzaku
48dbda2fa8 Fix #3352, add support for --ignore-not-found just like kubectl delete
Signed-off-by: suzaku <satorulogic@gmail.com>
2023-08-09 13:51:23 +08:00
MichaelMorris
830d4a9ee9 Add option to support cascade deletion options
Add --cascade=<background|foreground|orphan> option to helm uninstall
Current behaviour is hardcoded to background

Addresses issue: https://github.com/helm/helm/issues/10586

Signed-off-by: MichaelMorris <michael.morris@est.tech>
2023-02-02 11:22:32 +00:00
Mayank Thakur
fe00c9296d Fixed helm uninstall not deleting the resource.
* Added `nil` check for returned err.
  * Return in case of `err` when deleting the release

Signed-off-by: Mayank Thakur <thakurmayank88@gmail.com>
2022-04-12 12:55:47 +05:30
Mike Ng
75fe8883cc Rename newly introduced interface to InterfaceExt
Signed-off-by: Mike Ng <ming@redhat.com>
2021-08-27 09:38:04 -04:00
Mike Ng
d51a61f9ab Introduce a new interface for WaitForDelete() to avoid breaking backwards compatibility
Signed-off-by: Mike Ng <ming@redhat.com>
2021-08-26 17:30:55 -04:00
Mike Ng
655bdcd2fd feat: add optional boolean '--wait' flag to 'uninstall' command.
If set, 'uninstall' command will wait until all the resources are deleted before returning.
It will wait for as long as --timeout

closes #2378

Signed-off-by: Mike Ng <ming@redhat.com>
2021-08-26 15:31:49 -04:00
Du Zheng
87040536fb Improve the console output for resource policy keep to align with helm2.
Signed-off-by: Du Zheng <zsuzhengdu@gmail.com>
2020-10-29 22:37:24 -04:00
Matt Butcher
ed5fba5142 refactor the release name validation to be consistent across Helm
Signed-off-by: Matt Butcher <matt.butcher@microsoft.com>
2020-09-17 11:34:31 -06:00
Vibhav Bobade
47abe66fd2 Add checking of length of resourceList before creating of deleting
A chart being installed which only contains CRDs and not
any templates tries to install the resources by default.
The resourceList which is used in this case does not check
if there are resources present in it or not. This commit
adds checks to those particular places where we need to check
if the size of resourceList > 0 during installation and deletion.

Signed-off-by: Vibhav Bobade <vibhav.bobde@gmail.com>
2020-05-04 21:14:54 +05:30
Juan Matías de la Cámara Beovide
357d265de0 fix(helm): add --description flag to helm (#7074)
* fix(helm): add --description flag to 'helm install', 'helm upgrade', and 'helm uninstall'

When added, this flag allow us to add a custom description to the release. E.g. '--description "my custom description"'

Closes #7033

Signed-off-by: Juan Matias Kungfu de la Camara Beovide <juanmatias@gmail.com>

* fix(helm): fixed style issues on top of previous commit (3a43a9a487)

Closes #7033

Signed-off-by: Juan Matias Kungfu de la Camara Beovide <juanmatias@gmail.com>

*  fix(helm): fixed wrong test issue on top of previous commit (3a43a9a)

Closes #7033

Signed-off-by: Juan Matias Kungfu de la Camara Beovide <juanmatias@gmail.com>
2019-12-09 08:48:31 -08:00
Taylor Thomas
93abfd75ad Remove reference to stdtime to reduce confusion
Signed-off-by: Taylor Thomas <taylor.thomas@microsoft.com>
2019-10-16 21:01:52 -05:00
Taylor Thomas
aa429e150a feat(*): Adds custom time package for better marshalling
This package mainly exists to workaround an issue in Go
where the serializer doesn't omit an empty value for time:
https://github.com/golang/go/issues/11939. This replaces all
release and hook object time references with the new time package
so things actually marshal correctly

Signed-off-by: Taylor Thomas <taylor.thomas@microsoft.com>
2019-10-15 14:13:19 -06:00
Adam Reese
572b92dc8a feat(pkg/kube): add openapi validation for k8s objects
Add back OpenAPI validation for kubernetes objects.

Fixes: #6382

Signed-off-by: Adam Reese <adam@reese.io>
2019-10-08 12:55:19 -07:00
Matt Farina
9bc7934f35 Updating the module for v3 as the major version
Signed-off-by: Matt Farina <matt@mattfarina.com>
2019-10-03 14:27:05 -04:00
Vibhav Bobade
d00e328020 Applied check to actions
Signed-off-by: Vibhav Bobade <vibhav.bobde@gmail.com>
2019-08-27 04:16:02 +05:30
Jacob LeGrone
5ab42504f1 Merge branch 'dev-v3' of https://github.com/helm/helm into test-as-hook 2019-07-31 18:06:08 -04:00
Jacob LeGrone
caa4240a30 refactor(release): track test executions via Hook type
Signed-off-by: Jacob LeGrone <git@jacob.work>
2019-07-31 15:33:56 -04:00
Jacob LeGrone
72127c391c feat(test): define tests as Jobs and allow arbitrary supporting resources
This updates commands install, upgrade, delete, and test to share the
same implementation for hook execution.

BREAKING CHANGES:
- The `test-failure` hook annotation is removed.

Signed-off-by: Jacob LeGrone <git@jacob.work>
2019-07-31 15:33:56 -04:00
Taylor Thomas
f6116a7ca9 Fixes issues with delete
Signed-off-by: Taylor Thomas <taylor.thomas@microsoft.com>
2019-07-30 11:51:39 -06:00
Taylor Thomas
15fc57f8a3 ref(*): Refactors kube client to be a bit more friendly
This changes most of the KubeClient interface to only ever build objects once and
then pass in everything as lists of resources. As a consequence, we needed to refactor
several of the actions. I took the opportunity to refactor out some duplicated
code while I was in the same area

Signed-off-by: Taylor Thomas <taylor.thomas@microsoft.com>
2019-07-30 11:51:39 -06:00
Martin Hickey
5410e7d346 Fix style conformance issues
Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>
2019-07-29 19:17:35 +01:00
Taylor Thomas
29c343278e feat(action): Refactors unit tests with better fakes
This also adds unit tests for the Atomic and Wait functionality

Signed-off-by: Taylor Thomas <taylor.thomas@microsoft.com>
2019-07-11 14:45:05 -06:00
Adam Reese
0338576fc5 ref(pkg/kube): cleanup kube client interface
* move the main interface to it's own file
* removed summarizeKeptManifests() which was the last place kube.Get()
  was called
* when polling for hooks, use external types
* refactor out legacyschema
* refactor detecting selectors from object
* refactor creating test client

Signed-off-by: Adam Reese <adam@reese.io>
2019-05-15 12:31:47 -07:00
Adam Reese
b97f881be0 ref(*): use time.Duration for timeouts
Signed-off-by: Adam Reese <adam@reese.io>
2019-05-07 15:09:00 -07:00
Adam Reese
2dd4744d23 ref(pkg/kube): extract wait logic from install/update
This change adds a new method for waiting for kubernetes resources.

Signed-off-by: Adam Reese <adam@reese.io>
2019-05-07 12:29:11 -07:00
Adam Reese
b8bced2649 fix(pkg/action): load clients after flags have been parsed (#5681)
Signed-off-by: Adam Reese <adam@reese.io>
2019-05-07 12:02:07 -07:00
Matthew Fisher
0805a87140 ref(uninstall): purge release history by default
Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
2019-03-25 09:30:58 -07:00
Adam Reese
895e9192d4 feat(*): use vanity import helm.sh/helm
Signed-off-by: Adam Reese <adam@reese.io>
2019-03-13 13:43:47 -07:00
Matthew Fisher
f185103b60 ref(action): move AddFlags functions back to cmd
Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
2019-03-13 08:58:35 -07:00
Matthew Fisher
2571dbf82f ref: remove pkg/helm, pkg/hapi, pkg/tiller
Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
2019-03-12 09:47:12 -07:00