Commit graph

390 commits

Author SHA1 Message Date
Matt Farina
7ceeda6c58
bump version to v3.9.0
Signed-off-by: Matt Farina <matt.farina@suse.com>
2022-05-09 15:19:10 -04:00
Matt Farina
3fdb7cac01
Merge pull request #10110 from zegerius/main
Fix value precedence
2022-04-12 11:08:33 -04:00
Eng Zer Jun
2e3e22a003
test: use T.TempDir to create temporary test directory
The directory created by `T.TempDir` is automatically removed when the
test and all its subtests complete.

Reference: https://pkg.go.dev/testing#T.TempDir
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2022-02-12 13:54:54 +08:00
Martin Hickey
f0fd37d2c5 Replace golint with revive
golint which is used as one of the sublinters in golangci-lint is deprecated.
It is replaced with revive which is a drop-in replacement.

Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>

Co-authored-by: Martin Mulholland <mmulholl@redhat.com>
2022-01-20 15:19:40 +00:00
Matt Farina
0c8320b685
bump version to v3.8.0
Signed-off-by: Matt Farina <matt.farina@suse.com>
(cherry picked from commit d493f29c32)
2022-01-13 10:09:43 -05:00
mengjiao.liu
160da867d0 validate release name during install
Signed-off-by: mengjiao.liu <mengjiao.liu@daocloud.io>
2021-12-29 14:45:05 +08:00
Matt Farina
7838fb769d
Fix specifying of Kubernetes version from build scripts
This bug came about because of three issues that this change
corrects:
- The CI scripts run on a pull request did not test building
  Helm. This means that a failure to set a variable using LDFLAGS
  had no opportunity to be caught.
- #8608 provided a means to match the k8s version used in linting
  and chartutil with the version of the package we pull in. With
  one problem. It attempts to set a const as if it were a string.
  This is ignored and everyone missed it.
- #10325 moved those constants to vars so it could be set. This
  looked good and passed tests but missed that you can't set an
  int as if it were a string. See first bullet.

This change fixes this by moved the internal representation to
be a string. These are internal variables not exposed in the public
API which makes this change non-breaking to the API.

Closes #10367

Signed-off-by: Matt Farina <matt.farina@suse.com>
2021-11-18 11:48:02 -05:00
Sverre Boschman
81a373ead5 allow ldflags to overwrite k8s version
Signed-off-by: Sverre Boschman <1142569+sboschman@users.noreply.github.com>
2021-11-09 14:18:07 +01:00
Aram Zegerius
752aa6d462 Simplify testdata charts
Signed-off-by: Aram Zegerius <aram@zegeri.us>
Signed-off-by: Ankita Bhopatkar <ankitabhopatkar13@gmail.com>
2021-09-14 10:34:35 +02:00
Aram Zegerius
3fd4a11b18 Simplify testdata charts
Signed-off-by: Aram Zegerius <aram@zegeri.us>
Signed-off-by: Ankita Bhopatkar <ankitabhopatkar13@gmail.com>
2021-09-14 10:27:50 +02:00
Damien Nozay
65ec3d6fd6 Make validation errors easier to fix
Problem: the warnings don't give enough details about which
values are problematic, only the name of the leaf key. This is
all the more annoying when you have a chart depending on other charts.

```
mainchart
 |
 +- subchart1
 +- subchart2
 +- subchart3
```

Here are some warnings I get before the change:
```
coalesce.go:199: warning: destination for credentials is a table. Ignoring non-table value
coalesce.go:160: warning: skipped value for resources: Not a table.
coalesce.go:160: warning: skipped value for googleSheetsServiceAccount: Not a table.
coalesce.go:199: warning: destination for googleSheetsServiceAccount is a table. Ignoring non-table value
coalesce.go:199: warning: destination for resources is a table. Ignoring non-table value []
coalesce.go:199: warning: destination for credentials is a table. Ignoring non-table value
coalesce.go:199: warning: destination for credentials is a table. Ignoring non-table value
coalesce.go:160: warning: skipped value for resources: Not a table.
coalesce.go:160: warning: skipped value for googleSheetsServiceAccount: Not a table.
```

with fix:
```
coalesce.go:162: warning: skipped value for subchart1.resources: Not a table.
coalesce.go:162: warning: skipped value for subchart2.googleSheetsServiceAccount: Not a table.
coalesce.go:211: warning: destination for subchart3.aws.credentials is a table. Ignoring non-table value ()
coalesce.go:211: warning: destination for mainchart.subchart3.aws.credentials is a table. Ignoring non-table value ()
coalesce.go:211: warning: destination for mainchart.subchart2.googleSheetsServiceAccount is a table. Ignoring non-table value ()
coalesce.go:211: warning: destination for mainchart.subchart1.resources is a table. Ignoring non-table value ([])
coalesce.go:162: warning: skipped value for subchart1.resources: Not a table.
coalesce.go:162: warning: skipped value for subchart2.googleSheetsServiceAccount: Not a table.
coalesce.go:211: warning: destination for subchart3.aws.credentials is a table. Ignoring non-table value ()
```

Signed-off-by: Damien Nozay <damiennozay+github@gmail.com>

add tests

Signed-off-by: Damien Nozay <damiennozay+github@gmail.com>
2021-09-14 10:07:26 +02:00
Aram Zegerius
4b49f356a9 Add tests for multi-level dependencies.
Closes #9940

Signed-off-by: Aram Zegerius <aram@zegeri.us>
Signed-off-by: Ankita Bhopatkar <ankitabhopatkar13@gmail.com>
2021-09-10 15:49:05 +02:00
Damien Nozay
9fa373e8be Make validation errors easier to fix
Problem: the warnings don't give enough details about which
values are problematic, only the name of the leaf key. This is
all the more annoying when you have a chart depending on other charts.

```
mainchart
 |
 +- subchart1
 +- subchart2
 +- subchart3
```

Here are some warnings I get before the change:
```
coalesce.go:199: warning: destination for credentials is a table. Ignoring non-table value
coalesce.go:160: warning: skipped value for resources: Not a table.
coalesce.go:160: warning: skipped value for googleSheetsServiceAccount: Not a table.
coalesce.go:199: warning: destination for googleSheetsServiceAccount is a table. Ignoring non-table value
coalesce.go:199: warning: destination for resources is a table. Ignoring non-table value []
coalesce.go:199: warning: destination for credentials is a table. Ignoring non-table value
coalesce.go:199: warning: destination for credentials is a table. Ignoring non-table value
coalesce.go:160: warning: skipped value for resources: Not a table.
coalesce.go:160: warning: skipped value for googleSheetsServiceAccount: Not a table.
```

with fix:
```
coalesce.go:162: warning: skipped value for subchart1.resources: Not a table.
coalesce.go:162: warning: skipped value for subchart2.googleSheetsServiceAccount: Not a table.
coalesce.go:211: warning: destination for subchart3.aws.credentials is a table. Ignoring non-table value ()
coalesce.go:211: warning: destination for mainchart.subchart3.aws.credentials is a table. Ignoring non-table value ()
coalesce.go:211: warning: destination for mainchart.subchart2.googleSheetsServiceAccount is a table. Ignoring non-table value ()
coalesce.go:211: warning: destination for mainchart.subchart1.resources is a table. Ignoring non-table value ([])
coalesce.go:162: warning: skipped value for subchart1.resources: Not a table.
coalesce.go:162: warning: skipped value for subchart2.googleSheetsServiceAccount: Not a table.
coalesce.go:211: warning: destination for subchart3.aws.credentials is a table. Ignoring non-table value ()
```

Signed-off-by: Damien Nozay <damiennozay+github@gmail.com>

add tests

Signed-off-by: Damien Nozay <damiennozay+github@gmail.com>
2021-09-09 11:47:00 -07: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
Matt Farina
e6a92c4b62
bump version to 3.7
Signed-off-by: Matt Farina <matt.farina@suse.com>
(cherry picked from commit 7048ef6b30aa23abdcfcaf523cb4c42dff85add9)
2021-08-30 22:06:54 -04:00
Bernd Gutjahr
5cf9735a9d improved coalesce readability by getting rid of continue statements
Signed-off-by: Bernd Gutjahr <bernd.gutjahr@microfocus.com>
2021-08-26 06:34:37 +02:00
Bernd Gutjahr
1740e7f89b enhanced coelesce_test with some more test cases
Signed-off-by: Bernd Gutjahr <bernd.gutjahr@microfocus.com>
2021-08-26 06:34:37 +02:00
Giacomo Margaria
3b68afc1c8 Fix coalesce globals to prevent subchart globals to leak upstream
Signed-off-by: Giacomo Margaria <giacomo.margaria@gmail.com>
2021-05-31 00:19:19 +02:00
Matt Farina
3415b6e7b8
bump version to v3.6.0
Signed-off-by: Matt Farina <matt@mattfarina.com>
(cherry picked from commit af0feeddd91c729aa97327f33c9e3e3109b13561)
2021-05-18 11:05:59 -04:00
Matt Farina
d4cc130fa9
Merge pull request #9621 from sagikazarmark/ingress-v1
Ingress v1 template
2021-05-17 15:33:41 -07:00
Mark Sagi-Kazar
6d9e15bd1a
feat: add networking.k8s.io/v1 support to ingress template
Signed-off-by: Mark Sagi-Kazar <mark.sagikazar@gmail.com>
2021-04-25 12:22:57 +02:00
Thomas Dy
0156ca61ca Fix capabilities changes leaking into other tests
Signed-off-by: Thomas Dy <thatsmydoing@gmail.com>
2021-04-07 17:27:53 +09:00
Thomas Dy
538670fda6 Add tests for template --kube-version
Signed-off-by: Thomas Dy <thatsmydoing@gmail.com>
2021-04-07 17:27:53 +09:00
Thomas Dy
47c8f48f20 feat(helm): Support setting --kube-version
Signed-off-by: Thomas Dy <thatsmydoing@gmail.com>
2021-04-07 17:27:53 +09:00
Adam Reese
213a7df2dc
Merge pull request #9416 from croomes/resource-name-validation
Add name validation rules for different object kinds
2021-03-26 10:25:49 -07: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
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
Adam Reese
6ce9ba60b7
Merge pull request from GHSA-c38g-469g-cmgx
fix(*): Validate metadata semver and printable characters
2021-02-04 12:57:08 -08:00
Adam Reese
657ce552cb
fix(*): Validate metadata semver and printable characters
ref: https://github.com/helm/helm/security/advisories/GHSA-c38g-469g-cmgx

* Skip invalid chart versions when reading the repository index file or
  when programmatically adding a chart version.
* Adds semver validation and strips non-printable characters and
  normalizes spaces for string fields in Metadata.Validate()
* Fixes a unit test that was pulling a remote repo.  Now uses a local
  repo.
* Fixes ignored error in repo update command

Signed-off-by: Adam Reese <adam@reese.io>
2021-02-04 12:52:24 -08:00
Nick Jones
042567808f
Update default ingress values section to correspond with template
This commit updates the default section in values.yaml for the example
ingress definition to correspond with the template.

Signed-off-by: Nick Jones <nick@dischord.org>
2021-01-13 22:58:08 +00:00
Matt Farina
8082f6db45 bump version to
Signed-off-by: Matt Farina <matt@mattfarina.com>
(cherry picked from commit f546ebb1ac)
2021-01-05 21:37:16 -05:00
Joe Julian
fdcd22ef58
Reduce linting severity for users of out-of-date kubernetes (#8608)
* Reduce linting severity for users of out-of-date kubernetes

Fixes #8596

Signed-off-by: Joe Julian <me@joejulian.name>

* add more verbose deprecation info

Signed-off-by: Joe Julian <me@joejulian.name>

* use new upstream deprecations

Signed-off-by: Joe Julian <me@joejulian.name>

* do not error for custom resources

Signed-off-by: Joe Julian <me@joejulian.name>

* Define deprecation version in lint rules by LDFLAG

Signed-off-by: Joe Julian <me@joejulian.name>

* make comment clearer

Signed-off-by: Joe Julian <me@joejulian.name>

* Extend the k8s version discovery and constants to chartutil

Signed-off-by: Joe Julian <me@joejulian.name>

* remove awk dependency

Signed-off-by: Joe Julian <me@joejulian.name>

* align k8s version constant names between capabilities.go and deprecations.go

Signed-off-by: Joe Julian <me@joejulian.name>

* show the error if the unexpected happens

Signed-off-by: Joe Julian <me@joejulian.name>

* bump k8sVersionMinor and golden chart templates for k8s 1.20

Signed-off-by: Joe Julian <me@joejulian.name>

* bump for tests to match 1.20.1

Signed-off-by: Joe Julian <me@joejulian.name>
2021-01-05 16:05:33 -07:00
Marc Khouzam
bed1a42a39 fix(pkg/chartutil): Remove warning for nils
Nil tables should not be reported as non-tables.

Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
2020-12-16 15:54:29 -05:00
Matthew Fisher
f228a7c36c
Merge pull request #9057 from ssalaues/fix/ingress-templating-error
fix: ingress path issue
2020-12-02 08:35:56 -08:00
rimas
ce1a46899f Fixes #9083
Signed-off-by: rimas <rmocius@gmail.com>
2020-12-01 18:50:14 +02:00
Salim Salaues
50144aad03 fix: ingress path issue
Signed-off-by: Salim Salaues <salim@openinvest.co>
2020-11-24 00:20:47 -08:00
Martin Hickey
6696a9fa5f
Merge pull request #8970 from zerefwayne/patch-8965
Add remaining tests in TestDependentChartAliases
2020-11-06 13:15:55 +00:00
Aayush Joglekar
babc8c9a70 Add remaining tests in TestDependentChartAliases
Signed-off-by: Aayush Joglekar <aayushjog@gmail.com>
2020-11-03 01:50:59 +05:30
Martin Hickey
b83632e757 Update err message to use the regex pattern directly
Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>
2020-10-22 11:26:39 +00:00
Martin Hickey
5785dd6d49 Fix the lint error message for valid names
Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>
2020-10-22 11:14:46 +00:00
Matt Farina
ce4fa95868 bump version to v3.4.0
Signed-off-by: Matt Farina <matt@mattfarina.com>
(cherry picked from commit 7090a89efc)
2020-10-19 17:35:25 -04:00
Martin Hickey
8667aa4f98
Merge pull request #8874 from consideRatio/pr/helm-create-template-indentation
helm create: make generated YAML indentation more consistent
2020-10-13 20:04:39 +01:00
Matthew Fisher
e73af10d0b
Merge pull request #8696 from f0rmiga/patch-1
fix: boilerplate template indentation
2020-10-13 11:36:26 -07:00
Erik Sundell
1d9767fea2 helm create: make generated YAML indentation more consistent
Signed-off-by: Erik Sundell <erik@sundellopensource.se>
2020-10-12 15:45:27 +02:00
Matthew Fisher
2a74204508
go fmt
Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
2020-09-17 11:09:37 -07:00
Matt Farina
7953adb06c
Merge branch 'master' into fix/helm-create-overwrite 2020-09-17 13:56:39 -04:00
Matt Farina
11f75e420c
Merge pull request #8750 from technosophos/fix/helm-create-name
validate the name passed in during helm create
2020-09-17 13:51:05 -04:00
Matt Butcher
106f1fb45c
fixed bug that caused helm create to not overwrite modified files
Signed-off-by: Matt Butcher <matt.butcher@microsoft.com>
2020-09-17 11:35:46 -06: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
Thulio Ferraz Assis
b4bb73d8ce
fix: if not .Values.autoscaling.enabled indent
Signed-off-by: Thulio Ferraz Assis <thulio.assis@suse.com>
2020-09-16 20:42:05 -05:00