Commit Graph

27 Commits

Author SHA1 Message Date
Matthieu MOREL 56a2bb4188 chore: enable usetesting linter
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-05-30 08:12:11 +02:00
Benoit Tigeot c05bcbd498
Fix nil pointer dereference in ready test
Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2025-04-10 16:40:05 +02:00
Benoit Tigeot cbaac7652d
Call slog directly instead of using a wrapper
Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2025-04-10 15:35:36 +02:00
Benoit Tigeot b2380720eb
Migrate to pure slog without a custom wrapper
Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2025-04-07 16:46:08 +02:00
Benoit Tigeot b42767be40
Migrate more code to log adapter
Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2025-04-07 15:36:52 +02:00
Benoit Tigeot 83cdffe4ae
Migrate to a dedicated internal package for slog adapter + migrate more
Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2025-04-07 15:36:36 +02:00
Benoit Tigeot f4631bf3d8
Migrate kube package to slog
As for helm v4. We want to migrate logs to slog.

Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2025-04-07 15:35:20 +02:00
Scott Rigby 122e7b441a
Merge pull request #13458 from thudi/main
#13449 Resolves: Replacing NewSimpleClientSet to NewClientSet due to deprecation
2025-04-05 14:39:49 +01:00
Robert Sirchia 4da004e2dc
removing old apis
Signed-off-by: Robert Sirchia <rsirchia@outlook.com>
2025-02-25 15:15:06 -05:00
Matt Farina 2236294119 Updating to helm.sh/helm/v4
Since Helm is going through breaking changes with Helm v4, the version path to
Helm needs to be updated.

Signed-off-by: Matt Farina <matt.farina@suse.com>
2024-12-26 16:33:51 -05:00
KISHOREKUMAR THUDI 2c8cfaea41 Replacing NewSimpleClientSet to NewClientSet due to deprecation
Signed-off-by: KISHOREKUMAR THUDI <kishorekumarthudi@kishore.myfiosgateway.com>
2024-11-17 11:12:28 -05:00
Robert Sirchia 7e6b34d7dd
removing duplicate empty test
Signed-off-by: Robert Sirchia <rsirchia@outlook.com>
2024-10-23 15:17:44 -04:00
Robert Sirchia 16a4e37f20
fixing unit test as per Matt
Signed-off-by: Robert Sirchia <rsirchia@outlook.com>
2024-10-23 12:24:04 -04:00
Robert Sirchia a205af755e
adding more unit test
Signed-off-by: Robert Sirchia <rsirchia@outlook.com>
2024-10-22 09:49:41 -04:00
Robert Sirchia 999b85145a
adding test coverage for ready.go
Signed-off-by: Robert Sirchia <rsirchia@outlook.com>
2024-10-18 16:44:42 -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
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
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
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
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
Bhavin Gandhi c3310bb724 fix(pkg/kube): statefulSetReady: handle partition cases correctly
The partition value can be greater than number of replicas, in that
case no pods are rolled out. The expectedReplicas becomes a negative
number.
https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#partitions

In the cases where the update does not change anything in the pod
template, the updatedReplicas value from StatefulSet status remains
unchanged. Such updates can still set some partition value, and
UpdatedReplicas is always greater than expectedReplicas. Basically,
the StatefulSet is ready / rolled-out.

In both the above scenarios, providing `--wait` flag causes it to
timeout waiting indefinitely. Because updatedReplicas can never be
negative, or be equal to the expectedReplicas for the second case.

This commit handles both the scenarios by checking if UpdatedReplicas
is smaller than expectedReplicas. If it is, then the StatefulSet is
not ready yet.

Based on the code from kubectl rollout:
a450ebd59c/pkg/polymorphichelpers/rollout_status.go (L138-L141)

Closes #8674

Signed-off-by: Bhavin Gandhi <bhavin7392@gmail.com>
2021-11-26 19:06:25 +05:30
Jeff Rosenberg b13f3a13d4
Merge branch 'main' into error-on-failed-jobs-9285 2021-09-11 11:08:06 -05:00
lsowen 249d1b5fb9 Fix SIGSEGV when job.Spec.Completions is nil
Signed-off-by: lsowen <logan@s1network.com>
2021-08-22 13:32:27 -04:00
Rosenberg, Jeff cd04e3f418 Throw an error from jobReady() if the job exceeds its BackoffLimit
Closes #9285

Signed-off-by: Rosenberg, Jeff <jeff.rosenberg@icfnext.com>
2021-07-16 16:15:57 -05:00
Joe Lanford 98d98369ed
Add ReadyChecker to decouple ready check logic from --wait
Signed-off-by: Joe Lanford <joe.lanford@gmail.com>
2021-03-29 11:52:33 -04:00