Commit graph

69 commits

Author SHA1 Message Date
Chris Berry
2aa90b8f26
Refactor based on review comment
Signed-off-by: Chris Berry <bez625@gmail.com>
2025-02-21 19:00:41 -05:00
Chris Berry
5739197faa
Refactor based on review comment
Signed-off-by: Chris Berry <bez625@gmail.com>
2025-02-21 19:00:41 -05:00
Chris Berry
b8e13878fc
Add HookOutputFunc and generic yaml unmarshaller
Signed-off-by: Chris Berry <bez625@gmail.com>
2025-02-21 19:00:41 -05:00
Joe Julian
15e36139c1
Merge pull request #13130 from idsulik/issue-13127
fix: update error handling in Configuration.Init method, add tests for the method
2024-07-08 16:38:34 -07:00
Suleiman Dibirov
800c33a5aa fix: update error handling in Configuration.Init method, add tests for the method
Signed-off-by: Suleiman Dibirov <idsulik@gmail.com>
2024-06-19 07:46:38 +03:00
Marcin Owsiany
a6863a64ce Drop unused field.
Signed-off-by: Marcin Owsiany <porridge@redhat.com>
2024-04-04 11:14:23 +02: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
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
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
Craig O'Donnell
ddf8356c1f full source path when output-dir is not provided
Signed-off-by: Craig O'Donnell <craig@replicated.com>
2023-03-03 16:24:51 -05: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
d66c7db55a 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:25:32 -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
Graham Reed
82a2a2e85c Populate Capabilities.HelmVersion during install
Signed-off-by: Graham Reed <greed@7deadly.org>
2022-04-11 14:33:00 +01:00
Thomas Runyon
353d74e967 refactor internal/experimental/registry to pkg/registry
Signed-off-by: Thomas Runyon <runyontr@gmail.com>
2022-01-12 21:49:26 -05:00
Martin Hickey
699ea6dcef
Merge pull request #9066 from scaat/fix-specification
[FIX]Unified go specification
2021-06-02 11:55:53 +01:00
Simon Croome
c50372a8c1
Add/update deprecation notices
Signed-off-by: Simon Croome <simon.croome@storageos.com>
2021-03-22 16:43:10 +00:00
Scaat Feng
b6bd8d7363 [FIX]'rest' collides with imported package name
Signed-off-by: Scaat Feng <scaat.feng@gmail.com>
2020-11-26 13:45:13 +08:00
Scaat Feng
5c14eec3a3 [FIX]receiver names are different
Signed-off-by: Scaat Feng <scaat.feng@gmail.com>
2020-11-26 13:43:23 +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
Martin Hickey
4cc19d1d82 Fix typo
Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>
2020-07-31 07:57:17 +00:00
Matt Farina
44212f83dc
Fix issue with install and upgrade running all hooks
When #8156 was merged it had the side effect that all hooks were
run all the time. All the hooks were put in the flow of the
content rendered and sent to Kubernetes on every command.

For example, if you ran the following 2 commands the test hooks
would run:

    helm create foo
    helm install foo ./foo

This should not run any hooks. But, the generated test hook is run.

The change in this commit moves the writing of the hooks to output
or disk back into the template command rather than in a private
function within the actions. This is where it was for v3.2.

One side effect is that post renderers will not work on hooks. This
was the case in v3.2. Since this bug is blocking the release of v3.3.0
it is being rolled back. A refactor effort is underway for this section
of code. post renderer for hooks should be added back as part of that
work. Since post renderer hooks did not make it into a release it
is ok to roll it back for now.

There is code in the cmd/helm package that has been duplicated from
pkg/action. This is a temporary measure to fix the immediate bug
with plans to correct the situation as part of a refactor
of renderResources.

Signed-off-by: Matt Farina <matt@mattfarina.com>
2020-07-28 09:52:39 -04:00
Cristian Klein
9a4f4ec64b fix(helm): Avoid corrupting storage via a lock
If two `helm upgrade`s are executed at the exact same time, then one of
the invocations will fail with "already exists".

If one `helm upgrade` is executed and a second one is started while the
first is in `pending-upgrade`, then the second invocation will create a
new release. Effectively, two helm invocations will simultaneously
change the state of Kubernetes resources -- which is scary -- then two
releases will be in `deployed` state -- which can cause other issues.

This commit fixes the corrupted storage problem, by introducting a poor
person's lock. If the last release is in a pending state, then helm will
abort. If the last release is in a pending state, due to a previously
killed helm, then the user is expected to do `helm rollback`.

Closes #7274

Signed-off-by: Cristian Klein <cristian.klein@elastisys.com>
2020-07-13 22:54:52 +02:00
DongGang
ceff32d5f8
fix(template):Issue:helm template with --output-dir (#8156)
* fix(template):Issue:helm template with --output-dir doesn't write template with a hook to file

Close #7836

Signed-off-by: Dong Gang <dong.gang@daocloud.io>

* fix go file style

Signed-off-by: Dong Gang <dong.gang@daocloud.io>

* fix go file style

Signed-off-by: Dong Gang <dong.gang@daocloud.io>
2020-07-07 08:44:22 -07:00
Matt Butcher
524150c662
fix: use correct regular expression for Kubernetes names (#8013)
Signed-off-by: Matt Butcher <matt.butcher@microsoft.com>
2020-05-01 14:02:47 -06:00
Matt Butcher
bb47286f09
fix linting error with lookup function (#7969)
Signed-off-by: Matt Butcher <matt.butcher@microsoft.com>
2020-04-22 10:09:34 -06:00
Elliot Maincourt
21d2aa7f2b
Migrate SQL storage driver to Helm 3 (#7635)
* Migrate SQL storage driver to Helm 3

Signed-off-by: Elliot Maincourt <e.maincourt@gmail.com>

* Update pkg/storage/driver/sql.go

Co-Authored-By: Sebastian Pöhn <sebastian.poehn@gmail.com>
Signed-off-by: Elliot Maincourt <e.maincourt@gmail.com>

* Add authentication to releases_v3

Signed-off-by: Elliot Maincourt <e.maincourt@gmail.com>

* Fix migration

Signed-off-by: Elliot Maincourt <e.maincourt@gmail.com>

* Template the init migration

Signed-off-by: Elliot Maincourt <e.maincourt@gmail.com>

* Prevent potential SQL injection

Signed-off-by: Elliot Maincourt <e.maincourt@gmail.com>

* Use an SQL querybuilder

Signed-off-by: Elliot Maincourt <e.maincourt@gmail.com>

* Remove references to HELM_DRIVER_SQL_DIALECT

Signed-off-by: Elliot Maincourt <e.maincourt@gmail.com>

Co-authored-by: Sebastian Pöhn <sebastian.poehn@gmail.com>
Co-authored-by: Matt Butcher <matt.butcher@microsoft.com>
2020-04-16 14:53:40 -06:00
Adam Reese
c2da4fd53d
ref(*): kubernetes v1.18 (#7831)
Upgrade Kubernetes libraries to v0.18.0

Add new lazy load KubernetesClientSet to avoid missing kubeconfig error

In kubernetes v1.18 kubeconfig validation was added.  Minikube and Kind
both remove kubeconfig when stopping clusters.  This causes and error
when running any helm commands because we initialize the client before
executing the command.

Signed-off-by: Adam Reese <adam@reese.io>
2020-04-13 08:40:38 -07:00
Marc Khouzam
7f3339cb4e feat(tests): Allow to provision memory driver
The memory driver is used for go tests. It can also be used from the
command-line by setting the environment variable HELM_DRIVER=memory.
In the latter case however, there was no way to pre-provision some
releases.

This commit introduces the HELM_MEMORY_DRIVER_DATA variable which
can be used to provide a colon-separated list of yaml files specifying
releases to provision automatically.

For example:
   HELM_DRIVER=memory \
   HELM_MEMORY_DRIVER_DATA=./testdata/releases.yaml \
   helm list --all-namespaces

Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
2020-02-21 08:44:38 -05:00
Song Shukun
e9f40ed7a5 fix golint failure in pkg/action
Signed-off-by: Song Shukun <song.shukun@fujitsu.com>
2020-02-18 23:15:56 +09:00
Marc Khouzam
e6d2d10bad fix(tests): Add namespace support to memory driver
Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
2020-02-07 11:41:47 -05:00
Matt Butcher
6cc039ea79
fix: catch one additional discovery client warning (#7176)
Signed-off-by: Matt Butcher <matt.butcher@microsoft.com>
2020-01-16 13:54:22 -07:00
Josh Soref
02ad2b1187 Spelling (#7258)
* spelling: constraint

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

* spelling: cryptographic

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

* spelling: dependency

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

* spelling: doesnot

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

* spelling: don't

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

* spelling: unexpected

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

* spelling: dreadnought

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

* spelling: default

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

* spelling: envvars

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

* spelling: evaluates

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

* spelling: execute

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

* spelling: extractor

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

* spelling: frobnitz

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

* spelling: generated

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

* spelling: implementation

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

* spelling: jabba

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

* spelling: keywords

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

* spelling: kubernetes

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

* spelling: override

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

* spelling: package

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

* spelling: parsable

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

* spelling: progress

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

* spelling: recursively

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

* spelling: release

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

* spelling: cache

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

* spelling: representing

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

* spelling: serializer

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

* spelling: subchart

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

* spelling: utilities

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2019-12-18 12:04:08 +00:00
Matt Butcher
865c46c014
fix: stop discovery errors from halting chart rendering. (#6908)
This blocks a particular error (caused by upstream discovery client),
printing a warning instead of failing. It's not a great solution, but is
a stop-gap until Client-Go gets fixed.

Closes #6361

Signed-off-by: Matt Butcher <matt.butcher@microsoft.com>
2019-11-07 16:16:36 -07:00
Aaron Mell
31f2fea061 Passing the namespace to actionconfig.Init instead of the entire object.
Signed-off-by: Aaron Mell <amell@lumindigital.com>
2019-10-28 13:03:17 -05:00
Aaron Mell
eab9d2817d Revert "Allow namespace to be set by programs consuming helm."
bc2cd3c794

Signed-off-by: Aaron Mell <amell@lumindigital.com>
2019-10-28 12:33:47 -05:00
Aaron Mell
bc2cd3c794 Allow namespace to be set by programs consuming helm.
Signed-off-by: Aaron Mell <amell@lumindigital.com>
2019-10-26 23:16:28 -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
Aaron Mell
6a98d1f1d2 Code Review Changes
Signed-off-by: Aaron Mell <amell@lumindigital.com>
2019-10-14 13:14:14 -05:00
Aaron Mell
4eca26e4e1 Modified the scope of Kubeconfig so it could be set outside an env variable.
Signed-off-by: Aaron Mell <amell@lumindigital.com>
2019-10-14 13:14:14 -05:00
Taylor Thomas
01e593fbcd fix(action): Fixes ordering of variable binding
The recent init action config switched the order of how variables get bound
and where. This led to the namespace variable not being propagated down into
the calls to kubernetes.

Co-authored-by: Matthew Fisher <matt.fisher@microsoft.com>
Signed-off-by: Taylor Thomas <taylor.thomas@microsoft.com>
2019-10-11 11:41:57 -06:00
Aaron Mell
1d66a676c8 Moved the GetNamespace and KubeConfig function from action to cli
Signed-off-by: Aaron Mell <amell@lumindigital.com>
2019-10-10 13:35:46 -05:00
Aaron Mell
3264b75378 Refactoring after rebasing with latest
Signed-off-by: Aaron Mell <amell@lumindigital.com>
2019-10-10 13:35:23 -05:00
Aaron Mell
01d7657c1e Another Code review change
Signed-off-by: Aaron Mell <amell@lumindigital.com>
2019-10-10 13:34:25 -05:00
Aaron Mell
851e016e90 Reverted previous commit, changes based on code review feedback.
Signed-off-by: Aaron Mell <amell@lumindigital.com>
2019-10-10 13:34:25 -05:00
Aaron Mell
1ca2ab1d8d Moving actionInit from cmd/helm/helm to pgk/action/action to make it easier to instantiate the configuration
Signed-off-by: Aaron Mell <amell@lumindigital.com>
2019-10-10 13:34:24 -05:00