Commit graph

26 commits

Author SHA1 Message Date
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
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
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
Eric Lemieux
4c9972cb72 Add HelmVersion to Capabilities
Signed-off-by: Eric Lemieux <eric@lemieuxdev.com>
2020-06-15 13:30:08 -04:00
Matthew Fisher
bfb39c0c68
bump DefaultCapabilities to 1.18
Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
2020-05-13 11:16:14 -07:00
Taylor Thomas
b6f5762d46 fix(chartutil): Add the v1 apiextensions to the default scheme
Signed-off-by: Taylor Thomas <taylor.thomas@microsoft.com>
2019-10-29 12:10:58 -06:00
Yusuke Kuoka
6d91d1aca8 fix(v3): Allow rendering CRDs in helm template client-only validation
Fixes #6665
Ref https://github.com/helm/helm/pull/6729#issuecomment-547415165
Relates to #6729 and #6811

Signed-off-by: Yusuke Kuoka <ykuoka@gmail.com>
2019-10-29 22:23:51 +09:00
Taylor Thomas
59d3488d1c feat(template): Ports api-versions flag to v3
This is a port of #5392. It also takes care of the small chore to update the default k8s
version to 1.16, which is the latest supported version

Signed-off-by: Taylor Thomas <taylor.thomas@microsoft.com>
2019-10-07 13:30:06 -06:00
Adam Reese
097834de0a
ref(pkg/chartutil): remove k8s version object dependency
Flattens the `.Capabilities` built-in and removes useless kubernetes
runtime metadata.

Signed-off-by: Adam Reese <adam@reese.io>
2019-05-07 13:49:05 -07:00
Adam Reese
31819e4796
fix(pkg/chartutil): marshal capabilities VersionSet into slice
Marshal capabilities VersionSet into readable value.

Signed-off-by: Adam Reese <adam@reese.io>
2019-03-29 08:49:15 -07:00
Adam Reese
87e789f01f
fix(pkg/chartutil): only include external objects in capabilities
Signed-off-by: Adam Reese <adam@reese.io>
2019-03-28 23:37:32 -07:00
Adam Reese
d94707db86
ref(*): remove helmVersion chart constraint
* Remove helmVersion constraint from charts
* Guard compile time set variables behind `internal/`
* Allow configuration of UserAgent for HTTPGetter

Signed-off-by: Adam Reese <adam@reese.io>
2019-01-08 13:37:55 -08:00
Adam Reese
4f26b658d8
change copyright to "Copyright The Helm Authors" 2018-08-24 12:03:55 -07:00
Adam Reese
f012940d9c
ref(*): refactor chart/chartutil
ref(chartutil): move chart loading out of chartutil into new package
    add chart loader interface to allow lazy loading
feat(chart): create chart accessors
ref(*): cleanup requirements
ref(tiller): remove optional template engines
ref(tiller): simplify sorting releases and hooks
ref(*): code simplification
ref(hapi): move chart package out of hapi
ref(chart): add requirements and lock to Chart struct
2018-08-24 11:28:29 -07:00
Adam Reese
75c4df0b56
ref(tests): use golden files for testing command output 2018-05-09 08:37:20 -07:00
Adam Reese
36e034551f
ref(*): rebuild build version object 2018-05-02 15:26:26 -07:00
Adam Reese
29e772f631
ref(*): replace TillerVersion with HelmVersion 2018-04-20 00:37:34 -07:00
Adam Reese
68c0b6a24a
ref(proto): remove unused protobufs 2018-04-17 10:17:42 -07:00
Matt Farina
d5a865b5f4
fix(capabilities): Adding GitVersion to default set
Prior to this, using the semver template functions with the full
version, which is represented in the GitVersion, was not possible
for helm template and lint commands because the property was not
populated by default. This update adds default handling.

Closes #3349
2018-01-16 13:02:30 -05:00
Adam Reese
a31e3b8fe1
ref(*): kubernetes v1.9 support (#3234) 2018-01-05 12:30:26 -08:00
Kazuki Suda
3508cebbf6 Use the same defaults as done in helm lint for Capabilities 2017-09-11 10:09:42 +09:00
Adam Reese
85c41ef11a ref(*): kubernetes v1.6
Rebase on kubernetes v1.6
2017-04-11 15:42:23 -07:00
Matt Butcher
cb0a6c7e07
feat(tiller): add {{.Capabilities}} object
This adds the {{.Capabilities}} object to the template variables so that
chart authors can write charts that are aware of teh Kubernetes
capabilities of the current cluster.

Closes #1608
2017-01-09 18:09:20 -07:00