Commit graph

2446 commits

Author SHA1 Message Date
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
99e1dce8c8
Merge pull request #9950 from jeffrosenberg/error-on-failed-jobs-9285
Throw an error from jobReady() if the job exceeds its BackoffLimit
2023-07-13 08:21:58 -07: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
Joe Julian
14d363669f
Merge pull request #11529 from wujunwei/fix-update-dependency-panic
bugfix: SIGSEGV with OCI chart reference using helm template
2023-07-12 18:00:41 -07:00
Joe Julian
ec1d0d8671
Merge pull request #11456 from greed42/tpl-tests
Backfill tests for the `tpl` function
2023-07-12 17:21:07 -07:00
Andrew Block
d72b42da61
Added tests for created OCI annotation time format
Signed-off-by: Andrew Block <andy.block@gmail.com>
2023-07-04 04:51:46 -05:00
Andrew Block
c4870d990c
Add created OCI annotation
Signed-off-by: Andrew Block <andy.block@gmail.com>
2023-07-02 07:21:15 -05:00
Matt Farina
03911aeab7
Merge pull request #12036 from mattfarina/bump-version-3.12 2023-06-27 22:27:56 -04:00
Yarden Shoham
15e6066a45 chore: fix a typo in manager.go
actally -> actually

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
2023-06-25 20:07:02 +00:00
wujunwei
c87f846d88 add GetRegistryClient method
Signed-off-by: wujunwei <wjw3323@live.com>
2023-06-15 11:49:23 +08:00
Matt Farina
4e447d87cd
Merge pull request #11397 from wujunwei/fix-helm-lint-infinite-loop
bugfix: helm lint infinite loop
2023-06-14 10:38:13 -04:00
Matt Farina
c88d8969da
Merge pull request #12056 from kupnu4x/skeleton-helm-release-autoscaling-v2
update autoscaling/v2beta1 to autoscaling/v2 in skeleton chart
2023-06-13 16:06:38 -04:00
Matt Farina
1c4885fce7
Merge pull request #11501 from imanushin/add-test-for-exact-version
Add test for exact version selection
2023-05-30 12:58:14 -04:00
Joe Julian
d7805e68ae
Merge pull request #11455 from ksankeerth/dev-11451
Strict file permissions for repository.yaml
2023-05-25 11:25:19 -07:00
Graham Reed
f235f0f285 Check that missing keys are still handled in tpl
Signed-off-by: Graham Reed <greed@7deadly.org>
2023-05-11 22:16:30 +01:00
Joe Julian
17beedb49c
Merge pull request #11870 from cbodonnell/main
full source path for CRDs when output-dir is not provided
2023-05-08 17:23:07 -07:00
Dmitry Kamenskikh
b4a4c7a9d4 update autoscaling/v2beta1 to autoscaling/v2 in skeleton chart
Signed-off-by: Dmitry Kamenskikh <kupnu4x@gmail.com>
2023-05-05 13:59:11 +08:00
Matt Farina
1800554452
bump version to v3.12.0
(cherry picked from commit 54a0fac9b5e243d9922dbfb412bff17eb161e361)
Signed-off-by: Matt Farina <matt.farina@suse.com>
2023-05-01 14:08:09 -04:00
Matt Farina
b4b629c3c2
Merge pull request #11204 from sabre1041/oci-annotations
Attach annotations to OCI artifacts
2023-05-01 10:55:38 -04:00
Matt Farina
b81428919b
Merge pull request #12015 from yann-soubeyrand/bump-k8s-io-deps
chore: bump k8s.io dependencies to v0.27.1
2023-05-01 09:54:14 -04:00
Andrew Block
f900e9f1b1
Attach annotations to OCI artifacts
Signed-off-by: Andrew Block <andy.block@gmail.com>
2023-04-29 08:10:04 -05:00
Matt Farina
01dabe5312
Merge pull request #11948 from wujunwei/fix-failed-testcase-on-windows
fix: failed testcase on windows
2023-04-28 15:20:37 -04:00
Matt Farina
9705369da6
Merge pull request #11973 from joejulian/quiet_lint
fail quiet linting when an error occurs
2023-04-28 14:53:04 -04:00
Matt Farina
0833318b32
Merge pull request #9182 from pscheid92/4030-provide-literal-alternative-for-set-flag
Provide an alternative for --set and/or --set-string to take a value literally
2023-04-28 14:39:41 -04:00
Matt Farina
3b74c13768
Merge pull request #11479 from MichaelMorrisEst/cascade
Add option to support foreground cascade deletion
2023-04-27 15:43:14 -04:00
Tom Wieczorek
b9361407a3
Bump k8s.io deps from v0.26.0 to v0.27.0
Adapt to changes in 1.27 client libs:

* The OpenAPIGetter method is now private, but the Validator method does
  what is needed instead.
* The function wait.PollImmediateUntil is deprecated. Switch to the
  recommended new function wait.PollUntilContextCancel.

Related dependency changes:

change k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 => v0.0.0-20230308215209-15aac26d736a

And some transitive version changes:

add github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0
add github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1
remove github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153
github.com/go-errors/errors v1.0.1 => v1.4.2
github.com/go-openapi/jsonpointer v0.19.5 => v0.19.6
github.com/go-openapi/jsonreference v0.20.0 => v0.20.1
github.com/go-openapi/swag v0.19.14 => v0.22.3
github.com/golang/protobuf v1.5.2 => v1.5.3
github.com/mailru/easyjson v0.7.6 => v0.7.7
github.com/onsi/ginkgo/v2 v2.4.0 => v2.9.1
github.com/onsi/gomega v1.23.0 => v1.27.4
github.com/rogpeppe/go-internal v1.9.0 => v1.10.0
golang.org/x/mod v0.8.0 => v0.9.0
golang.org/x/net v0.7.0 => v0.8.0
golang.org/x/term v0.5.0 => v0.6.0
golang.org/x/tools v0.6.0 => v0.7.0
gotest.tools/v3 v3.0.3 => v3.4.0
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 => v0.0.0-20221116044647-bc3834ca7abd
sigs.k8s.io/kustomize/api v0.12.1 => v0.13.2
sigs.k8s.io/kustomize/kyaml v0.13.9 => v0.14.1

Signed-off-by: Tom Wieczorek <twieczorek@mirantis.com>
2023-04-13 10:48:42 +02:00
Matt Farina
cf3d2531a8
Merge pull request #11898 from willzgli/waitbatchPerform
Fix goroutine leak in perform
2023-04-11 11:21:21 -04:00
Matt Farina
7c9d636f40
Fix goroutine leak in action install
During the install process there was a place where an install
process could be stuck trying to write to a channel. This would
happen when a context had completed prior to performInstall
finishing. In a short running Helm Client this was not a problem.
But, for long running applications that use Helm as an SDK there
are problems where a memory leak ends up happening due to
goroutines never being able to complete.

This fix provides a means for performInstall to write to its
channel using the method already used to fix the upgrade
issue of the same kind.

Fixes #11805

Signed-off-by: Matt Farina <matt.farina@suse.com>
2023-04-10 16:45:41 -04:00
Matt Farina
10587613cf
Merge pull request #11949 from dirkmueller/goarches
Fix 32bit-x86 typo in testsuite
2023-04-10 12:26:19 -04:00
Joe Julian
853c18002f
fix quiet lint does not fail on non-linting errors
Signed-off-by: Joe Julian <me@joejulian.name>
2023-04-10 09:22:24 -07: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
Aman Nijhawan
eea2f27bab
Fixes Readiness Check for statefulsets using partitioned rolling update. (#11774)
* Fixes Readiness Check for statefulsets using partitioned rolling update.
Fixes #11773

This change updates readiness check in ready.go to correctly
account for statefulsets that are utilizing a partitioned upgrade.
These statefulsets only upgrade a subset of the managed pods with each call
to helm upgrade. This causes the upgrade to legitimately hit the condition where
sts.status.CurrentRevision != sts.Status.UpdateRevision which causes helm to mark
the upgrade has failed when in fact it is successful.

This change fixes that behavior to only check when partition is unspecified or 0.

Signed-off-by: Aman Nijhawan <anijhawan@yugabyte.com>

* Adding a unit test to verify that partitioned rolling upgrade for a statefulset works.

Signed-off-by: Aman Nijhawan <anijhawan@yugabyte.com>

---------

Signed-off-by: Aman Nijhawan <anijhawan@yugabyte.com>
Co-authored-by: Aman Nijhawan <anijhawan@yugabyte.com>
2023-03-30 10:39:29 -06:00
wujunwei
878e962b23 fix: failed testcase on windows
Signed-off-by: wujunwei <wjw3323@live.com>
2023-03-29 10:27:44 +08:00
Dirk Müller
1fc8369356
Fix 32bit-x86 typo in testsuite
The GOARCH here is 386 not i386. This caused a slightly odd test
suite failure on that architecture:

--- FAIL: TestPlatformPrepareCommand (0.00s)
     plugin_test.go:45: Expected arg="os-arch", got "linux-s390x"
     plugin_test.go:64: Expected arg="os-arch", got "linux-s390x"

Signed-off-by: Dirk Müller <dirk@dmllr.de>
2023-03-28 15:10:19 +02:00
wujunwei
cd2609d08e add some test case
Signed-off-by: wujunwei <wjw3323@live.com>
2023-03-28 15:04:07 +08:00
wujunwei
8e1c3d0d39 fix comment grammar error.
Signed-off-by: wujunwei <wjw3323@live.com>
2023-03-28 15:04:07 +08:00
wujunwei
316d3fb56a bugfix:(#11391) helm lint infinite loop
when malformed template object

Signed-off-by: wujunwei <wjw3323@live.com>
2023-03-28 15:04:07 +08:00
Matt Farina
046646c944
Handle failed DNS case for Go 1.20+
Go 1.20 introduced DNS/CNAME handling changes. This can cause an
IP address represented in hex, oct, etc to be looked up as DNS and
fail. This change introduces a mock DNS resolver.

Note, with the mock resolver, we don't need to use 0x7f000001 any
longer. Keeping because it was already there.

Signed-off-by: Matt Farina <matt.farina@suse.com>
2023-03-23 13:22:07 -04:00
Matt Farina
4e7e939f19
Updating the Go version in go.mod
At this time both Go 1.19 and 1.20 are supported. The version
specified in the go.mod file is the minimum version we expect Helm
to be compiled against. This is the oldest supported version to
support environments where others compile Helm. The Helm project
is using Go 1.20 to build Helm itself.

Updating to Go 1.19 also includes dealing with io/ioutil
deprecation and some additional linting issues around staticcheck.
All the staticcheck issues were in test files so linting was
skipped for those.

Signed-off-by: Matt Farina <matt.farina@suse.com>
2023-03-22 11:52:30 -04:00
Matt Farina
50c22ed7f9
Bump the Go version
Needed to gofmt source to meet changes in style

Signed-off-by: Matt Farina <matt.farina@suse.com>
2023-03-22 11:29:26 -04:00
Matt Farina
299a6463a0
Merge pull request #11886 from hiddeco/properly-invalidate-client
Properly invalidate client after CRD install
2023-03-22 10:36:41 -04:00
willzgli
11150cdcc6 Fix goroutine leak in perform
Signed-off-by: willzgli <willzgli@tencent.com>
2023-03-17 23:30:12 +08: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
Hidde Beydals
68f7b1f194
Properly invalidate client after CRD install
As the CRDs are installed before the capabilities are gathered, the
current call to invalidate the discovery client is premature and
expensive.

What actually is required is an invalidation of the REST mapper, as
otherwise the Helm install action may later on fail with a `resource
mapping not found` error. More specifically when the caller of the
action is making use of a persisting[1] `RESTClientGetter`.

Which is not something done by the Helm CLI (albeit it could, and this
would potentially save quite some resources?). But is a default
configuration offered by the Helm SDK via `kube.New` when a nil value
is provided as the `getter`.

[1]: https://github.com/kubernetes/cli-runtime/blob/v0.26.2/pkg/genericclioptions/config_flags.go#L118

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-07 20:07:41 +01: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
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
Andrew Block
c94306f75d
Reimplemented change in httpgetter for insecure TLS option
Signed-off-by: Andrew Block <andy.block@gmail.com>
2023-03-03 07:33:17 -06:00
Andrew Block
ec5e29e801
Removed conditional
Signed-off-by: Andrew Block <andy.block@gmail.com>
2023-03-03 07:33:17 -06:00
Andrew Block
154f37efec
Added insecure option to login subcommand
Signed-off-by: Andrew Block <andy.block@gmail.com>
2023-03-03 07:33:17 -06:00