Commit graph

564 commits

Author SHA1 Message Date
Terry Howe
b3a458fde9
Merge pull request #31970 from isumitsolanki/fix/31965-decouple-cli-from-kube
refactor(cli): decouple EnvSettings from pkg/kube to avoid import cycles
2026-05-03 05:59:17 -06:00
Matheus Pimenta
a4a9cc7a31
Upgrade Go to 1.26, Kubernetes to 1.36, kstatus to 1.1
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2026-04-25 17:06:10 +01:00
Terry Howe
29d309e56b
Merge pull request #31981 from abhay1999/fix/ssa-error-context
Some checks failed
build-test / build (push) Waiting to run
CodeQL / Analyze (push) Waiting to run
golangci-lint / golangci-lint (push) Waiting to run
release / release (push) Waiting to run
release / canary-release (push) Waiting to run
Scorecard supply-chain security / Scorecard analysis (push) Waiting to run
govulncheck / govulncheck (push) Has been cancelled
fix(kube): clarify server-side apply patch errors
2026-04-20 06:04:11 -06:00
Sumit Solanki
213c869a98 refactor(cli): share RetryingRoundTripper via pkg/kubeenv
Move implementation to pkg/kubeenv per review; kube.RetryingRoundTripper
remains a type alias for API compatibility. pkg/cli uses kubeenv only.

Signed-off-by: Sumit Solanki <sumit.solanki@ibm.com>
2026-04-09 22:46:41 +05:30
Terry Howe
a7f84439aa
test(kube): fix flaky WaitForDelete test by avoiding informer sync race
The previous fix (increasing timeout / reducing deletion delay) did not
work because the flakiness is not a timing problem at all.

Root cause: fluxcd/cli-utils HasSynced() returns true after the initial
list item is *popped* from DeltaFIFO, which is before AddFunc delivers
the ResourceUpdateEvent to the collector. This creates a race where the
SyncEvent can arrive at the statusObserver *before* the pod's Current
status is recorded. When that happens:
  - statusObserver sees pod as Unknown
  - Unknown is skipped for WaitForDelete (by design, to handle resources
    that were already deleted before watching started)
  - AggregateStatus([], NotFoundStatus) == NotFoundStatus → cancel()
  - The watch context is cancelled before DeleteFunc can fire
  - Final check: pod still Current → error

The test intent is to verify that waitForDeleteCtx (not the cancelled
generalCtx) is selected. A non-existent resource satisfies this:
  - With waitForDeleteCtx=Background(): informer syncs with empty list
    → Unknown → cancel → success ✓
  - With generalCtx (cancelled, wrong): context immediately done
    → ctx.Err() appended → error returned ✓

Remove the goroutine-based deletion and the pod creation to eliminate
the race while preserving the context-selection assertion.

Signed-off-by: Terry Howe <terrylhowe@gmail.com>
2026-04-07 08:23:39 -06:00
Terry Howe
4c0d21f53f
test(kube): fix flaky WaitForDelete timing in status wait tests
TestMethodContextOverridesGeneralContext/WaitForDelete used a 1s
timeout with a 500ms deletion delay, leaving only ~500ms for the
fake watcher to propagate the delete event. On loaded CI runners
this window is too tight and causes intermittent failures.

Increase the timeout to 5s and reduce the deletion delay to 100ms
so there is ample headroom. Apply the same deletion-delay reduction
to TestStatusWaitForDelete which shares the same pattern.

Signed-off-by: Terry Howe <terrylhowe@gmail.com>
2026-04-07 04:26:12 -06:00
abhay1999
f257c95c78 fix(kube): clarify server-side apply patch errors
Signed-off-by: abhay1999 <abhaychaurasiya19@gmail.com>
2026-03-30 19:20:40 +05:30
Matthieu MOREL
7edfff33eb chore: fix unnecessary-format issues from revive
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2026-03-23 07:07:27 +01:00
George Jenkins
610547b570
Merge pull request #31873 from mmorel-35/perfsprint-pkg-5-3294250
chore(pkg): fix perfsprint linter issues part 5
2026-03-13 19:00:01 -07:00
George Jenkins
d3df72e560
Merge pull request #31932 from TerryHowe/fix/remove-legacy-import-comments-test-files
Some checks are pending
build-test / build (push) Waiting to run
CodeQL / Analyze (push) Waiting to run
golangci-lint / golangci-lint (push) Waiting to run
release / release (push) Waiting to run
release / canary-release (push) Waiting to run
Scorecard supply-chain security / Scorecard analysis (push) Waiting to run
pkg/kube: remove legacy import comments from test files
2026-03-12 12:30:10 -07:00
Terry Howe
e64d628a13
fix(kube): remove legacy import comments from test files
Remove pre-Go modules import path comments from pkg/kube test files
(ready_test.go, resource_test.go, statuswait_test.go) for consistency
with the rest of the package.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Terry Howe <terrylhowe@gmail.com>
2026-03-12 06:12:04 -06:00
abhay1999
d7cdc9e8fb pkg/kube: remove legacy import comments
Import path comments (e.g. `// import "helm.sh/helm/v4/pkg/kube"`) are
a pre-Go modules convention no longer needed in module-aware builds.
Some files in pkg/kube had these comments while others did not, causing
inconsistency that triggered downstream Kythe indexing errors.

Remove the import comments from all affected files to make the package
declaration consistent across the directory.

Fixes #31846

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: abhay1999 <abhaychaurasiya19@gmail.com>
2026-03-12 11:10:44 +05:30
tsinglua
259f181808 chore: fix some minor issues in the comments
Signed-off-by: tsinglua <tsinglua@outlook.com>
2026-03-11 16:55:34 +08:00
George Jenkins
df8e0301ed
Merge pull request #31878 from mmorel-35/perfsprint-pkg-3-39f7a9f
Some checks failed
build-test / build (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
golangci-lint / golangci-lint (push) Has been cancelled
release / release (push) Has been cancelled
release / canary-release (push) Has been cancelled
Scorecard supply-chain security / Scorecard analysis (push) Has been cancelled
chore(pkg): fix perfsprint linter issues part 3
2026-03-02 07:28:25 -08:00
Matthieu MOREL
1d2d63cc43 chore(pkg): enable perfsprint linter
#### Description

enable perfsprint linter in pkg/cmd

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2026-02-26 18:55:56 +01:00
Matthieu MOREL
c25c988cfb chore(pkg): enable perfsprint linter
#### Description

enable perfsprint linter in pkg/registry

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2026-02-26 18:55:55 +01:00
Matthieu MOREL
6c2cb2f547 chore(pkg): enable perfsprint linter
#### Description

enable perfsprint linter in pkg/cmd

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2026-02-26 18:55:55 +01:00
Terry Howe
d275b925c4
Merge pull request #31852 from rohansood10/fix/31846-import-comment
Some checks are pending
build-test / build (push) Waiting to run
CodeQL / Analyze (push) Waiting to run
golangci-lint / golangci-lint (push) Waiting to run
release / release (push) Waiting to run
release / canary-release (push) Waiting to run
Scorecard supply-chain security / Scorecard analysis (push) Waiting to run
fix: correct import comment in statuswait.go from v3 to v4
2026-02-24 17:58:00 -07:00
George Jenkins
be7cdb69e5
Merge pull request #31806 from mmorel-35/errorlint-pkg-4-15f432a
fix(pkg): errorlint linter
2026-02-24 16:00:34 -08:00
George Jenkins
92b64e87ad
chore: fixes
Signed-off-by: George Jenkins <gvjenkins@gmail.com>
2026-02-23 16:46:35 -08:00
rohansood10
c59c140ce0 fix: correct import comment in statuswait.go from v3 to v4
The import comment in pkg/kube/statuswait.go still referenced
helm.sh/helm/v3/pkg/kube while all other files in the package
correctly reference helm.sh/helm/v4/pkg/kube. This mismatch
causes downstream processing errors (e.g. kythe) when vendoring
Helm.

Fixes #31846

Signed-off-by: rohansood10 <rohansood10@users.noreply.github.com>
2026-02-21 09:32:44 -08:00
Matthieu MOREL
4d0ae7f33a fix(pkg): errorlint linter
#### Description

errorlint linter in pkg

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2026-02-09 07:45:34 +01:00
Matheus Pimenta
787b61cedb
Revert "Consider GroupVersionKind when matching resources"
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2026-01-29 06:04:56 +00:00
Austin Abro
ec0726523e
whitespace
Signed-off-by: Austin Abro <austinabro321@gmail.com>
2026-01-22 15:45:29 -05:00
Austin Abro
63b40a7a5e
use logger with waiter
Signed-off-by: Austin Abro <austinabro321@gmail.com>
2026-01-22 09:12:53 -05:00
Matheus Pimenta
b0b35f1231
feat(kstatus): fine-grained context options for waiting
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2026-01-21 19:03:20 +00:00
Matheus Pimenta
bbec77c1f7
bugfix(kstatus): do not wait forever on failed resources
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2026-01-17 12:18:16 +00:00
Evans Mungai
40a9de1086
Merge pull request #31412 from fmuyassarov/devel/rollback
Some checks failed
build-test / build (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
golangci-lint / golangci-lint (push) Has been cancelled
release / release (push) Has been cancelled
release / canary-release (push) Has been cancelled
Scorecard supply-chain security / Scorecard analysis (push) Has been cancelled
Fix rollback for missing resources
2026-01-13 11:07:24 +00:00
Evans Mungai
f46f1ce55d
Update pkg/kube/statuswait.go
Signed-off-by: Evans Mungai <mbuevans@gmail.com>
2026-01-12 18:32:31 +00:00
Matheus Pimenta
59ece92bed
pkg/kube: introduce support for custom kstatus readers
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2026-01-12 18:16:26 +00:00
Feruzjon Muyassarov
374aeb4b4e
Fix rollback for missing resources
Signed-off-by: Feruzjon Muyassarov <feruzjon.muyassarov@est.tech>
2026-01-05 18:34:33 +02:00
George Jenkins
fa41d60d73
Merge pull request #31239 from StephanieHhnbrg/test-actions-pkg
Some checks are pending
build-test / build (push) Waiting to run
CodeQL / Analyze (push) Waiting to run
golangci-lint / golangci-lint (push) Waiting to run
release / release (push) Waiting to run
release / canary-release (push) Waiting to run
Scorecard supply-chain security / Scorecard analysis (push) Waiting to run
Add tests to action package to improve coverage
2026-01-02 20:24:27 -08:00
Matt Farina
fe1c749183
Fixing failing tests for cli-tools update
Tests were failing for cli-utils watcher because upstream k8s made
changes that impacted cli-utils. In k8s WatchListClient is now
enabled by default. Fake clients used for testing don't know this
semantic. cli-utils leverages reflection in k8s to handle this.
The Helm tests didn't handle this well.

The tests are updated to use PrependReactor and PrependWatchReactor
in the same way that cli-utils does for testing. This works without
wrapping the client.

Signed-off-by: Matt Farina <matt.farina@suse.com>
2025-12-27 10:25:08 -05:00
George Jenkins
a15db7f087 Replace deprecated NewSimpleClientset
Signed-off-by: George Jenkins <gvjenkins@gmail.com>
2025-12-26 08:36:42 -08:00
George Jenkins
24e8297343
Merge pull request #31610 from mohsenmottaghi/fix-helm-4-watch-strategy
Some checks are pending
build-test / build (push) Waiting to run
CodeQL / Analyze (push) Waiting to run
golangci-lint / golangci-lint (push) Waiting to run
release / release (push) Waiting to run
release / canary-release (push) Waiting to run
Scorecard supply-chain security / Scorecard analysis (push) Waiting to run
fix: use namespace-scoped watching to avoid cluster-wide LIST permiss…
2025-12-22 12:41:17 -08:00
Brenden Ehlers
1c119bcaa6 fix: add default casess to switch statements
Signed-off-by: Brenden Ehlers <brenden@theehlers.org>
2025-12-21 09:13:24 -07:00
Mohsen Mottaghi
d6b35cedeb
test(statuswait): fix Copilot code review suggestion for goroutine in tests
Signed-off-by: Mohsen Mottaghi <mohsenmottaghi@outlook.com>
2025-12-16 17:43:15 +03:30
Mohsen Mottaghi
a1543d5947
test(statuswait): add more tests suggested by Copilot code review
add missing coverage for the positive case where cluster-scoped resources (like ClusterRole or Namespace) should work correctly

Signed-off-by: Mohsen Mottaghi <mohsenmottaghi@outlook.com>
2025-12-16 17:33:29 +03:30
Mohsen Mottaghi
dd44f4ecd0
test(statuswait): add some tests for statuswait
Adding some tests for multi namespace deployment, simulate restrcited rbac access and mixed namespace scope and cluster scope resources

Signed-off-by: Mohsen Mottaghi <mohsenmottaghi@outlook.com>
2025-12-16 13:55:07 +03:30
Mohsen Mottaghi
3dd54ed0b6
fix: use namespace-scoped watching to avoid cluster-wide LIST permissions
Signed-off-by: Mohsen Mottaghi <mohsenmottaghi@outlook.com>
2025-12-16 13:55:02 +03:30
Robert Sirchia
4cf7d8d025
Merge pull request #31641 from wangjingcun/main
chore: fix some comments to improve readability
2025-12-12 19:34:20 +01:00
wangjingcun
858cf31583 chore: fix some comments to improve readability
Signed-off-by: wangjingcun <wangjingcun@aliyun.com>
2025-12-12 12:01:35 +08:00
Mads Jensen
a18e59e465 Enable the sloglint linter
Signed-off-by: Mads Jensen <atombrella@users.noreply.github.com>
2025-12-09 08:24:36 +01:00
Stephanie Hohenberg
31131cff9b Add tests to action package to improve coverage
Signed-off-by: Stephanie Hohenberg <stephanie.hohenberg@gmail.com>
2025-12-03 13:17:58 +05:30
Matt Farina
61d289c119
Merge pull request #31518 from gjenkins8/gjenkins/fix_update_create
Some checks failed
build-test / build (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
golangci-lint / golangci-lint (push) Has been cancelled
release / release (push) Has been cancelled
release / canary-release (push) Has been cancelled
Scorecard supply-chain security / Scorecard analysis (push) Has been cancelled
fix: Use server-side apply for object create during update
2025-11-21 17:13:56 -05:00
shuv0id
2dc5864f44 fix: add missing context to debug logs
Adds chart name to dependency logs, namespace to resource waiting logs,
and confirmation message when all resources are ready.

Addresses #31520

Signed-off-by: shuv0id <110290476+shuv0id@users.noreply.github.com>
2025-11-18 22:25:34 +05:30
George Jenkins
f8a49f1852 fixup test
Signed-off-by: George Jenkins <gvjenkins@gmail.com>
2025-11-17 08:31:56 -08:00
George Jenkins
a9cdc78116 logs
Signed-off-by: George Jenkins <gvjenkins@gmail.com>
2025-11-17 08:08:23 -08:00
George Jenkins
b1a976073f fix
Signed-off-by: George Jenkins <gvjenkins@gmail.com>
2025-11-17 08:02:46 -08:00
George Jenkins
18616e6ce9 fix: Use server-side apply for object create during update
Signed-off-by: George Jenkins <gvjenkins@gmail.com>
2025-11-15 20:37:30 -05:00