112 Commits

Author SHA1 Message Date
Nathan Baulch
ff9dd262e3 Fix typos
Signed-off-by: Nathan Baulch <nathan.baulch@gmail.com>
2024-09-14 10:29:56 +10:00
Matt Farina
c261d0655c Merge pull request #12876 from manno/sdk-ignore-missing-annotations
Allow install, update action to adopt existing resources (sdk only)
2024-08-14 15:56:37 -04:00
anessi
acf7158565 feat(helm): add --skip-schema-validation flag to helm 'install', 'upgrade' and 'lint'
When --skip-schema-validation is set, any schema contain in the helm chart is ignored. Defaults to 'false'.

Closes #10398

Signed-off-by: anessi <16045045+anessi@users.noreply.github.com>
2024-06-25 16:43:48 +02:00
Andrew Block
414cf94666 Merge pull request #11600 from miles-w-3/chart-notes
Added support for hiding notes from install/upgrade output
2024-06-12 06:24:59 -05:00
Mario Manno
a7856c0398 Add ability to adopt unmanaged resources
Allow the SDK actions to adopt existing resources. This allows install
and update to overwrite resources. If TakeOwnership is not set, adoption
is only possible if they existing resources have the right labels
(managed-by) and annotations (release-name, ...).

Signed-off-by: Mario Manno <mmanno@suse.com>
2024-03-13 14:09:23 +01:00
Matt Farina
25c473834e Enabling hide secrets on install and upgrade dry run
This change adds a new flag to the install and upgrade commands in
the Helm client and properties to the install and upgrade action.
The new flag is --hide-secret and can only be used with the
--dry-run flag.

The --dry-run flag is designed to send all chart rendered manifests to
stdout so that they can be inspected.

When the --hide-secret flag is used the Secret content is removed from
the output.

Signed-off-by: Matt Farina <matt.farina@suse.com>
2024-03-13 08:34:28 -04:00
Scott Rigby
2745909d3d Merge pull request #9653 from Okhoshi/feat/reset-then-reuse-flag
feat(helm): Add --reset-then-reuse-values flag to 'helm upgrade'
2023-11-04 03:46:03 -04:00
Miles Wilson
0c541398f2 Added support for hiding notes from install/upgrade output
Signed-off-by: Miles Wilson <wilson.mil@icloud.com>
2023-10-05 15:59:58 -04:00
b4nks
f004d42847 remove useless print during prepareUpgrade
Signed-off-by: b4nks <b4nks@protonmail.com>
2023-10-02 19:56:52 +02:00
Joe Julian
4ff7d90872 Merge remote-tracking branch 'upstream/main' into add-labels-to-install-upgrade 2023-08-23 10:42:16 -07:00
Joe Julian
7de6d7f162 Merge branch 'main' into feat/reset-then-reuse-flag
Signed-off-by: Joe Julian <me@joejulian.name>
2023-08-01 16:43:55 -07:00
Matt Farina
343389856b Merge pull request #12162 from mattfarina/fix-merge-values-ugh
Fix multiple bugs in values handling
2023-07-26 09:30:09 -04:00
Dmitry Chepurovskiy
7b13ac9914 Added error in case try to supply custom label with name of system label during install/upgrade
Signed-off-by: Dmitry Chepurovskiy <me@dm3ch.net>
2023-07-25 17:55:05 +03:00
Matt Farina
96e33e2773 Tweaking new dry-run internal handling
There are a few changes to the new dry-run handling:

1. Some documentation is added to help clarify what is happening
   and what is expected.
2. DryRun is never changed by internal handling. If an API user
   sets the property it is not changed by our code.
3. The behavior on contacting the server with false/none is made
   consistent between install and upgrade.

Signed-off-by: Matt Farina <matt.farina@suse.com>
2023-07-20 14:26:46 -04:00
Matt Farina
838b12191e Merge pull request #9426 from tapaskapadia/feat/lookup-dryrun
feat(helm): add ability for --dry-run to do lookup functions
2023-07-20 13:30:52 -04:00
Joe Julian
8554d518d5 Merge pull request #10397 from mtesseract/mc/fix-err-message-on-existing-resource-conflict
Adjust error message wrongly claiming that there is a resource conflict
2023-07-13 08:20:16 -07:00
Matt Farina
0a5148faff Fix multiple bugs in values handling
First, some notes about priority and how some code flow works.

For Helm handling values, the expected order of precidence is:
1. User specified values (e.g CLI)
2. Imported values
3. Parent chart values
4. Subchart values

Helm handles dependency values slightly differently. If there are dependencies
in the charts folder that are not marked as dependencies all of the values,
including nil values, are pulled in. If those charts are listed as a
dependency in the Chart.yaml file than they are processed for import handling.
Prior to the changes here, it caused nil values at the top level to NOT remove
values specified.

The changes:

1. The order of priority was chagned from the list above. Parnet chart values
would override specifically imported values. This is due to a change from
just over a year ago that introduced a bug. That was undone by changing the
precidence when maps were merged.

2. To handle merging while retaining the nil values, which was causing
inconsistent behavior, a new set of Merge functions were introduced. These
functions are just like coalesce except that they DO NOT remove nil/null values.
The new functions are used in a backward compatible manner meaning some new
functions were introduced that called them.

Specific issues fixed (that are known):

Closes #9027

Can now delete subkeys from charts when specified in the parent. This behavior
was previously inconsistent. Sometimes they could be deleted and other times
it did not work. Now it is consistent.

Closes #10899

Imported values (from library or other subcharts) are now used following the
order above.

The previous behavior was inconsistent. import-values using just a string
would import them. When named with a child/parent it did not work if the
parent already had a value. If string and named were mixed the imports
worked if the string happened first but just for the string not the named.
If the named parent/child went first then none of them worked for cases
where the parent already had a value. It was inconsistent and the tests
sometimes mirrored the functionality rather than expected behavior.

Tests for this fall into the sub-packages and are in the template tests
to verify it's happening in the output. Including having values passed
at the CLI as the ultimate highest priority to be used.

This relates to a fix that went in for #9940. The expected values there don't
fit the precedence above where the parent value would override the imported
value. That fix/change introduced more bugs.

Closes #10052

This is the case where imported values using the parent/child designation
just didn't work right. That has been fixed and there are tests. The underlying
issue had to do with the precedence order handling.

Note, a lot of tests were added. Hope we got it more right this time.

Signed-off-by: Matt Farina <matt.farina@suse.com>
2023-06-26 11:37:21 -04:00
Tapas Kapadia
4b7248e361 feat(helm): add ability for --dry-run to do lookup functions
When a helm command is run with the --dry-run flag, it will try to connect to the cluster
if the value is 'server' to be able to render lookup functions.
Closes helm#8137

Signed-off-by: Tapas Kapadia <tapaskapadia10@gmail.com>
2023-04-08 18:43:01 -05:00
Tapas Kapadia
4899e8a788 feat(helm): add ability for --dry-run to do lookup functions
When a helm command is run with the --dry-run flag, it will try to connect to the cluster
if the value is 'server' to be able to render lookup functions.
Closes helm#8137

Signed-off-by: Tapas Kapadia <tapaskapadia10@gmail.com>
2023-03-10 02:45:30 -06:00
Soule BA
11738dde51 Provide a helper to set the registryClient in cmd
If enabled the registryClient is set using a helper that accepts the TLS
flags. This keeps the client creation consistent accross the different
commands.

Signed-off-by: Soule BA <bah.soule@gmail.com>
2023-03-03 07:33:17 -06:00
Dmitry Chepurovskiy
6853c3eab5 Merge remote-tracking branch 'origin/main' into add-labels-to-install-upgrade 2023-02-17 02:02:25 +02:00
Matt Farina
863bc74e5a Update to func handling
Signed-off-by: Matt Farina <matt@mattfarina.com>
2023-02-03 15:36:32 -05:00
Tapas Kapadia
f9e54b6079 feat(helm): add ability for --dry-run to do lookup functions
When a helm command is run with the --dry-run flag, it will try to connect to the cluster
if the value is 'server' to be able to render lookup functions.
Closes #8137

Signed-off-by: Tapas Kapadia <tapaskapadia10@gmail.com>
2023-01-30 17:04:10 -06:00
Tapas Kapadia
ddb33580db feat(helm): add ability for a dry-run to evaluate lookup functions
When a helm command is run with the --dry-run-option=server flag, it will try to connect to the cluster
to be able to render lookup functions.
Closes #8137

Signed-off-by: Tapas Kapadia <tapaskapadia10@gmail.com>
2023-01-23 13:18:59 -06:00
Tapas Kapadia
4d67dfabaa feat(helm): add ability for --dry-run to do lookup functions
When a helm command is run with the --dry-run flag, it will try to connect to the cluster
if the value is 'server' to be able to render lookup functions.
Closes #8137

Signed-off-by: Tapas Kapadia <tapaskapadia10@gmail.com>
2023-01-16 12:43:15 -06:00
Tapas Kapadia
51281c195a feat(helm): add ability for --dry-run to do lookup functions
When a helm command is run with the --dry-run flag, it will try to connect to the cluster
if the value is 'server' to be able to render lookup functions.
Closes helm#8137

Signed-off-by: Tapas Kapadia <tapaskapadia10@gmail.com>
2023-01-16 12:43:15 -06:00
Tapas Kapadia
92a6640f8a feat(helm): add ability for --dry-run to do lookup functions
When a helm command is run with the --dry-run flag, it will try to connect to the cluster
to be able to render lookup functions.
Closes #8137

Signed-off-by: Tapas Kapadia <tapaskapadia10@gmail.com>
2023-01-16 12:43:15 -06:00
Dominic Evans
7c74f1dd02 fix: improve logging & safety of statefulSetReady
Confirm that the current and updated revision numbers also match as part
of the readiness check. Add coverage for readiness scenarios where
StatefulSet status does not reflect the most recent generation of the
StatefulSet yet.

Also add additional logging around the sts transitions from non-ready to
ready.

Fixes: #10163

Signed-off-by: Dominic Evans <dominic.evans@uk.ibm.com>
2022-06-28 09:48:17 +01:00
Dmitry Chepurovskiy
f96acb4fc8 Adding support merging new custom labels with original release labels during upgrade
Signed-off-by: Dmitry Chepurovskiy <dm3ch@dm3ch.net>
Signed-off-by: Dmitry Chepurovskiy <me@dm3ch.net>
2022-06-17 21:36:43 +03:00
Dmitry Chepurovskiy
6afad6bb61 Added upgrade --install labels argument support
Signed-off-by: Dmitry Chepurovskiy <dm3ch@dm3ch.net>
Signed-off-by: Dmitry Chepurovskiy <me@dm3ch.net>
2022-06-17 21:36:33 +03:00
Matt Farina
1ec0aacb88 Merge pull request #10486 from gridai/fix-install-leak
Fix install memory/goroutine leak
2022-01-27 15:03:58 -05:00
Matt Farina
548ec55cf9 Fix panic with OCI for install, upgrade, and show
When range support for OCI went in via #10527 it created a situation
where some lookups for a chart could cause a panic. This change
makes sure the registry client is available to lookup OCI charts

Signed-off-by: Matt Farina <matt.farina@suse.com>
2022-01-12 21:30:27 -05:00
Neven Miculinic
5059ae843e Fix install memory/goroutine leak
Signed-off-by: Neven Miculinic <neven.miculinic@gmail.com>
2021-12-20 10:17:38 +01:00
Jerome Küttner
9a492f8240 Channel should remain open if there is still a routine that wants to write into it
Signed-off-by: Jerome Küttner <j.kuettner@mittwald.de>
2021-12-06 18:07:47 +01:00
Jerome Küttner
ad3d2cc8ef Fix memory leak in upgrade action
fixes helm/helm#10439

Signed-off-by: Jerome Küttner <j.kuettner@mittwald.de>
2021-12-06 17:54:46 +01:00
Moritz Clasmeier
8613770f78 Adjust error message wrongly claiming that there is a resource conflict
Signed-off-by: Moritz Clasmeier <moritz@stackrox.com>
2021-11-24 11:20:39 +01:00
Guangwen Feng
9b7a45a384 Fix a golint issue caused by typo
Signed-off-by: Guangwen Feng <fenggw-fnst@cn.fujitsu.com>
2021-11-01 17:39:58 +08:00
Stephane Moser
c62ce12bed Refactor SIGTERM logic
Use context to handle SIGTERM in the cmd/helm instead of pkg/action

Signed-off-by: Stephane Moser <moser.sts@gmail.com>
2021-07-26 01:04:58 +01:00
Stephane Moser
c6c4157c43 Move locks from global var to the structs
Signed-off-by: Stephane Moser <moser.sts@gmail.com>
2021-07-04 12:10:11 +01:00
Stephane Moser
660183d659 Add test for atomic upgrade and install when it is interrupted
Add tests when the install release is Interrupted and the flag Wait or Atomic is set

Signed-off-by: Stephane Moser <moser.sts@gmail.com>
2021-07-04 12:07:31 +01:00
Stephane Moser
3434053d38 Hande SIGINT in install command
Replicate the same logic in that was implementd in the upgrade action to handle SIGINT
Rename mutexes to isolate the variables

Signed-off-by: Stephane Moser <moser.sts@gmail.com>
2021-07-04 12:07:02 +01:00
Stephane Moser
d7833eb2b0 Refactor logic
Use mutex to lock the action to report the upstream function
Wrap logic to report to upstream function in the function reportToPerformUpgrade

Signed-off-by: Stephane Moser <moser.sts@gmail.com>
2021-07-04 12:07:02 +01:00
Stephane Moser
027cea48bf Handle SIGTERM
Change the logic to release Upgrade to handle SIGTERMs
Extract logic to 2 goroutine so it is possible to handle SIGTERMS and the release flow
Fix go style

Signed-off-by: Stephane Moser <moser.sts@gmail.com>
2021-07-04 12:06:25 +01:00
David Mládek
d6eab46876 Add --udpate-dependencies to upgrade command
Signed-off-by: David Mládek <david.mladek.cz@gmail.com>
2021-04-28 22:22:28 +02:00
Quentin Devos
a9d59f946a feat(helm): add --reset-then-reuse-values flag to 'helm upgrade'
When '--reset-then-reuse-values' is used on 'helm upgrade', the chart's values will be
reset to the values of the deployed chart while the current release's values will be
reused and merged with the values passed as argument (is any). '--reset-values' and
'--reuse-values' flags take precedence over `--reset-then-reuse-values', making it
ignored if one or the other is also used.

Closes #8085, #3957

Signed-off-by: Quentin Devos <quentin@devos.pm>
2021-04-27 23:34:32 +02:00
Josh Soref
2bf8fdf45d chore: Spelling (#9410)
* spelling: annotate

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: asserts

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: behavior

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: binary

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: contain

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: copied

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: dependency

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: depending

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: deprecated

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: doesn't

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: donot

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: github

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: inputting

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: iteration

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: jabberwocky

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: kubernetes

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: length

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: mismatch

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: multiple

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: nonexistent

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: outputs

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: panicking

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: plugins

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: parsing

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: porthos

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: regular

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: resource

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: repositories

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: something

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: strict

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: string

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: unknown

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2021-03-15 21:11:57 -04:00
zh168654
bfc575dec2 add waitwithjobs instead of changing wait api
Signed-off-by: zh168654 <zhangye.168@163.com>
2020-11-05 17:13:15 +08:00
zh168654
957d2a2bf9 add wait-for-jobs flag
Signed-off-by: zh168654 <zhangye.168@163.com>
2020-11-03 22:07:24 +08: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
Matt Butcher
96d9ab9663 fix name length check on lint (#8543)
Signed-off-by: Matt Butcher <matt.butcher@microsoft.com>
2020-09-01 10:44:52 -06:00