Commit graph

313 commits

Author SHA1 Message Date
Matt Farina
a753ee7f43
Merge pull request #12866 from robertsirc/Correcting-Linting-Errors
Correcting linting errors
2024-04-10 14:04:34 -04:00
Matt Farina
2dea5bf335
Merge pull request #11790 from Nordix/waitRetry
Add robustness to wait status checks
2024-03-14 13:23:14 -04:00
Robert Sirchia
d58d7b3762 Fixing all the linting errors
Cleaned up all the linting errors we are getting.

Signed-off-by: Robert Sirchia <rsirchia@outlook.com>
2024-03-11 17:13:34 -04:00
Matt Farina
c042264a9d
Fix issues when verify generation readiness was merged
CI, tests, and building failed after #10920 was merged. This change
fixes the issues that were introduced.

Signed-off-by: Matt Farina <matt.farina@suse.com>
2024-01-08 22:40:28 -05:00
Matt Farina
b299359f66
Merge pull request #10920 from muang0/readiness-generation-check
Verify generation in readiness checks
2024-01-08 22:29:31 -05: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
Serge Logvinov
b0d163771e feat: print failed hook name
Add more details when a hook fails.

Signed-off-by: Serge Logvinov <serge.logvinov@sinextra.dev>
2023-10-12 17:26:11 +03:00
Joe Julian
eb4edc96c5
Merge pull request #10965 from mattfarina/factory-comment
Adding details on the Factory interface
2023-08-28 12:13:56 -07:00
Joe Julian
02ef594a43
Merge pull request #11591 from ruanxin/use_wrapped_error
Use wrapped error so that ErrNoObjectsVisited can be compared
2023-08-01 16:17:50 -07:00
Stefan McShane
1a3e9a95dd addressing comment
Signed-off-by: Stefan McShane <stefanmcshane@users.noreply.github.com>
2023-07-19 12:35:14 -04:00
MichaelMorris
d2cf8c66f1 Updated for review comments
Signed-off-by: MichaelMorris <michael.morris@est.tech>
2023-07-13 18:22:37 +01:00
MichaelMorris
fc74964f8a Add robustness to wait status checks
When a user specifies --wait for an install or upgrade this commit will enable the user to specifiy a number of retries to attepmt if a status check fails
Errors including a HTTP status code < 500 will not be retried

Signed-off-by: MichaelMorris <michael.morris@est.tech>
2023-07-13 17:26:21 +01: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
dcd54d59e6
Merge branch 'main' into readiness-generation-check
Signed-off-by: Joe Julian <me@joejulian.name>
2023-05-10 16:48:22 -07:00
Matt Farina
8b19f8df0e
Adding details on the Factory interface
This covers both the property and the minimal copy of the Factory
interface. It also notes that this interface is not covered by the
Helm backwards compatibility and why.

Signed-off-by: Matt Farina <matt.farina@suse.com>
Signed-off-by: Joe Julian <me@joejulian.name>
2023-05-05 17:20:31 -07: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
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
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
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
willzgli
11150cdcc6 Fix goroutine leak in perform
Signed-off-by: willzgli <willzgli@tencent.com>
2023-03-17 23:30:12 +08:00
muang0
141fa4a037
Update pkg/kube/ready.go
more readable debug log fmt (i64)

Co-authored-by: Bjorn Svensson <bjorn.a.svensson@est.tech>
Signed-off-by: muang0 <joden1995@gmail.com>
2023-02-26 09:23:13 -05:00
muang0
4cb62d1262
Update pkg/kube/ready.go
more readable debug log fmt (i64)

Co-authored-by: Bjorn Svensson <bjorn.a.svensson@est.tech>
Signed-off-by: muang0 <joden1995@gmail.com>
2023-02-26 09:22:58 -05:00
muang0
dbb21fcf44
Update pkg/kube/ready.go
more readable debug log fmt (i64)

Co-authored-by: Bjorn Svensson <bjorn.a.svensson@est.tech>
Signed-off-by: muang0 <joden1995@gmail.com>
2023-02-26 09:22:35 -05:00
muang0
fcc03324a6
Update pkg/kube/ready.go
more readable debug log fmt (i64)

Co-authored-by: Bjorn Svensson <bjorn.a.svensson@est.tech>
Signed-off-by: muang0 <joden1995@gmail.com>
2023-02-26 09:22:18 -05:00
muang0
a1a1aafb7d
Update pkg/kube/ready.go
more readable debug log fmt (i64)

Co-authored-by: Bjorn Svensson <bjorn.a.svensson@est.tech>
Signed-off-by: muang0 <joden1995@gmail.com>
2023-02-26 09:21:36 -05:00
cpanato
006bc0f39d
update k8s registry domain
Signed-off-by: cpanato <ctadeu@gmail.com>
2023-02-17 09:50:04 +01:00
MichaelMorris
830d4a9ee9 Add option to support cascade deletion options
Add --cascade=<background|foreground|orphan> option to helm uninstall
Current behaviour is hardcoded to background

Addresses issue: https://github.com/helm/helm/issues/10586

Signed-off-by: MichaelMorris <michael.morris@est.tech>
2023-02-02 11:22:32 +00:00
Matt Farina
36e18fa6e1
Fix improper use of Table request/response to k8s API
Fixes #11712

A change was made that when validation was turned off the Kubernetes
packages were building objects as a Table type. This was done for
display purposes. When details about the objects was going to be
printed as part of #10912.

This broke rollback, and possibly other functionality, as a Table
type was returned in some cases that needed the regular object.
This caused things to break silently.

The fix involved adding in a new Function (and interface) to
query for tables instead of the objects themselves. There was not
a clean way to add it to the existing function that covered all
cases.

A second problem was noticed along the way. When data was output
via status as YAML or JSON it was in the form of a table rather
than the objects themselves. This did not reflect expectations
and did not match the functionality in kubectl. The code was
updated to return a table when that was presented and the objects
when they are being output for YAML or JSON. The API also supports
this handling to SDK users can replicate this functionality.

API changes made here were never released. The functions were
developed for this release of Helm and only ever appeared in an
RC. In this case, they can be changed.

Signed-off-by: Matt Farina <matt.farina@suse.com>
2023-01-12 08:38:10 -05:00
Matt Farina
774c6ce703
Merge pull request #11439 from phoenixsqf/main
use intstr.GetScaledValueFromIntOrPercent instead of the deprecated
2023-01-09 18:08:40 -05:00
Xin Ruan
a2b98281a1 Use errors.Is to compare
Signed-off-by: Xin Ruan <xin.ruan@sap.com>
2022-12-14 15:46:39 +01:00
Soujanya Mangipudi
038cc4a0ca
Merge branch 'main' into main
Signed-off-by: Soujanya Mangipudi <somangip@microsoft.com>
2022-12-12 10:48:20 -08:00
Xin Ruan
f01486a0ef Use wrapped error so that ErrNoObjectsVisited can be compared after return.
Signed-off-by: Xin Ruan <xin.ruan@sap.com>
2022-12-01 17:52:31 +01:00
Martin Hickey
3974136b6e
Merge pull request #11426 from cenkalti/leader-changed
Fix handling of "leader changed" errors
2022-11-16 15:57:09 +00:00
Andrew Block
269dd247d0
Merge pull request #11300 from porridge/better-logging
During deletion, explicitly log already deleted resource.
2022-11-01 01:00:57 -05:00
Qifan Shen
9d59d92abb use intstr.GetScaledValueFromIntOrPercent instead of the deprecated
Signed-off-by: Qifan Shen <sqfphoenix@163.com>
2022-10-13 16:58:24 +08:00
Cenk Alti
d32c623699 Revert "Tolerate temporary errors from etcdserver"
This reverts commit ebc79fa807.

Signed-off-by: Cenk Alti <cenkalti@gmail.com>
2022-10-11 19:53:14 -04:00
Davanum Srinivas
ebc79fa807
Tolerate temporary errors from etcdserver
There are cases when the etcdserver is temporarily unavailable and the
errors that we get back from kube-apiserver reflect that error. It looks
like we bail out immediately when these errors happen currently. We
should retry until timeout is reached when this sort of errors happen.

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2022-10-01 20:12:38 -04:00
Soujanya Mangipudi
ffa19a4b5d Addressing review comments - move printing code out of client.go
Signed-off-by: Soujanya Mangipudi <somangip@microsoft.com>

fix circleci tests

Signed-off-by: Soujanya Mangipudi <somangip@microsoft.com>

fix formatting errors

Signed-off-by: Soujanya Mangipudi <somangip@microsoft.com>

fix tests

Signed-off-by: Soujanya Mangipudi <somangip@microsoft.com>

fix tests

Signed-off-by: Soujanya Mangipudi <somangip@microsoft.com>

fix gofmt issue

Signed-off-by: Soujanya Mangipudi <somangip@microsoft.com>
2022-09-09 13:29:19 -07:00
Soujanya Mangipudi
20e3577543 Addressing review comments:
Extend Interface with new InterfaceResources to avoid breaking changes
Move change to staus command behind --show-resources flag

Signed-off-by: Soujanya Mangipudi <somangip@microsoft.com>
2022-09-09 13:28:57 -07:00
Soujanya Mangipudi
9d5be803bc feat(helm): Supporting helm3 to show up resource names that were deployed as part of release in helm status command
Creating a new PR based on this existing stale PR https://github.com/helm/helm/pull/7728

Signed-off-by: Soujanya Mangipudi <somangip@microsoft.com>

# Conflicts:
#	go.sum
2022-09-09 13:28:48 -07:00
Marcin Owsiany
b7c35d2a0f During deletion, explicitly log already deleted resource name.
Unfortunately errors from the API server do not always (do they ever?) contain
the name of the resource in question.

Deletions for multiple resources are processed concurrently, so in a resulting
log, a preceding "Starting delete" line might be for a different object.

Signed-off-by: Marcin Owsiany <porridge@redhat.com>
2022-09-06 12:29:01 +02:00
James Oden
d008340891 ready checker- comment update
Signed-off-by: James Oden <james.oden.dev@gmail.com>
2022-08-31 22:01:24 -04:00
James Oden
4f99c86914 ready checker- remove duplicate statefulset generational check
Signed-off-by: James Oden <james.oden.dev@gmail.com>
2022-08-31 22:01:05 -04:00
James Oden
f067073e23 Merge branch 'main' into readiness-generation-check 2022-08-31 21:41:34 -04:00
Dominic Evans
7c74f1dd02 fix: improve logging & safety of statefulSetReady
Confirm that the current and updated revision numbers also match as part
of the readiness check. Add coverage for readiness scenarios where
StatefulSet status does not reflect the most recent generation of the
StatefulSet yet.

Also add additional logging around the sts transitions from non-ready to
ready.

Fixes: #10163

Signed-off-by: Dominic Evans <dominic.evans@uk.ibm.com>
2022-06-28 09:48:17 +01:00
Andrew Seigner
bd7c97f786 Bump k8s packages from 0.23.6 to 0.24.0
This required modifying the `kube.Factory` interface to conform to
changes in k8s' `cmdutil.Factory` interface:
fe3772890f

Signed-off-by: Andrew Seigner <andrew@sig.gy>
2022-05-04 10:58:09 +00:00
James Oden
d94c5094f6 Verify generation in readiness checks
Signed-off-by: James Oden <james.oden.dev@gmail.com>
2022-05-02 01:35:09 -04:00