Commit graph

22 commits

Author SHA1 Message Date
Nathan Baulch
ef85fa7f2d
Grammar fixes
Signed-off-by: Nathan Baulch <nathan.baulch@gmail.com>
2024-09-14 10:30:31 +10:00
Matt Farina
847369c184
Update to Go 1.21 for builds
Noteis:
1. This moves golangci scanning to a GitHub action. This will
   enable inline pointers to issues in the PR where linting fails.
2. Go 1.21 is specified in the go.mod because Kubernetes libs
   require it.
3. The lint issues were removed. Some were fixed while others
   were handled by skipping linting or using _ as an argument.
   Many of these can be refactored later for better cleanup.

Signed-off-by: Matt Farina <matt.farina@suse.com>
2024-01-08 15:48:36 -05:00
Sean Mills
ce87ece23e Remove excessive logging
Resolves helm unittest issue helm-unittest/helm-unittest#237

Signed-off-by: Sean Mills <sean.m.mills@gmail.com>
2023-11-29 20:27:53 -06:00
Matt Farina
25371e2f0d Fixing precedence issue with the import of values.
The ordering should be:
1. User specified values (e.g CLI)
2. Parent chart values
3. Imported values
4. Sub-chart values

This enables parnet charts to import large set of values from a
child and then override select values.

This change is needed for backwards compatibility.

Fixes #12460

Signed-off-by: Matt Farina <matt.farina@suse.com>
2023-10-11 14:56:12 -04:00
Joe Julian
bc8bef4c15
Merge remote-tracking branch 'upstream/main' into fix2 2023-08-08 23:05:53 -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
AdamKorcz
2f13355e40 pkg/chartutil: fix nil-dereference
Signed-off-by: AdamKorcz <adam@adalogics.com>
2023-03-22 14:56:41 +00:00
Aram Zegerius
c4952c9c8c
Fix value precedence
Fix value precedence when importing values from child. Closes https://github.com/helm/helm/issues/9940

Signed-off-by: Aram Zegerius <aram@zegeri.us>
2021-09-07 17:25:34 +02:00
Martin Hickey
9d7907342d
Merge pull request #7514 from fhopfensperger/fix-7497
fixed dependencies processing in case of helm install or upgrade for …
2020-03-02 09:28:27 +00:00
Tomáš Kohout
b4f716413c Printing name of chart that do not have requested import value.
Signed-off-by: Tomas Kohout <tomas.kohout@leveris.com>
2020-02-24 11:59:51 +01:00
Florian Hopfensperger
d03db32c25 fixed dependencies processing in case of helm install or upgrade for disabled/enabled sub charts
Signed-off-by: Florian Hopfensperger <f.hopfensperger@gmail.com>
2020-02-03 11:30:26 +01: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
Taylor Thomas
319045d351
Merge pull request #6547 from SimonAlling/processDependencyConditions
ref(pkg/chartutil): Simplify processDependencyConditions
2019-10-02 14:26:10 -06:00
Simon Alling
a40debd42b ref(pkg/chartutil): Simplify processDependencyConditions
Before this commit, `r.Enabled` was modified if and only if a boolean
was found in the for loop, and in that case, it was assigned the value
of said boolean, just in a more complicated way.

Signed-off-by: Simon Alling <alling.simon@gmail.com>
2019-10-01 18:38:38 +02:00
Matthew Fisher
37f7cc0851
Merge pull request #4917 from derkoe/dev-v3-fix-requirement-condition
fix(pkg/chartutil): conditions for alias and umrella charts (#3734)
2019-09-30 14:50:19 -07:00
Taylor Thomas
c9c95ea148 ref(*): Moves packages to internal
These packages are generally used only for logic inside of Helm and
can later be re-exported as needed

Signed-off-by: Taylor Thomas <taylor.thomas@microsoft.com>
2019-08-09 16:02:33 -06: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
Matt Butcher
f3bfae5ea7
fix: fix a number of style errors (#5136)
This fixes a dozen or so style errors, almost all of which were just missing comments.

I left several which are fixed in other outstanding PRs, or which belong to code that is about to be removed.

Signed-off-by: Matt Butcher <matt.butcher@microsoft.com>
2019-01-07 21:40:24 -07:00
Christian Koeberl
62533e2b0e fix(pkg/chartutil): conditions for alias and umrella charts (#3734)
Enable to use charts with dependencies that have conditions (e.g. in
umbrella charts). Allow aliases for dependencies that have dependencies
with conditions.

Closes #3734

Signed-off-by: Christian Koeberl <christian.koeberl@gmail.com>
2018-12-17 11:19:56 +01:00
Adam Reese
2b81eea1e2
ref(*): replace byte array with map for Release config
Signed-off-by: Adam Reese <adam@reese.io>
2018-12-04 15:57:24 -08:00
Adam Reese
6fc8c9e079
ref(pkg/chartutil): simplify chart dependency unit tests
- simplify unit tests
- refactor typed errors
- unexport internal functions

Signed-off-by: Adam Reese <adam@reese.io>
2018-11-29 10:30:52 -08:00
Adam Reese
85aef0d3d7
ref(pkg/chart): rename Requirements to Dependencies
Signed-off-by: Adam Reese <adam@reese.io>
2018-11-28 10:20:33 -08:00
Renamed from pkg/chartutil/requirements.go (Browse further)