fix(kube): clarify server-side apply patch errors#31981
Conversation
Signed-off-by: abhay1999 <abhaychaurasiya19@gmail.com>
d1e4473 to
f257c95
Compare
There was a problem hiding this comment.
Pull request overview
This PR improves Helm’s Kubernetes server-side apply (SSA) patch error reporting by adding explicit SSA context and resource identifiers to generic patch failures, addressing confusion where raw API errors didn’t indicate they came from the SSA path.
Changes:
- Wrap generic errors returned from
patchResourceServerSide()with aserver-side apply failedprefix plus namespace/name and GVK. - Add a regression test covering a “duplicate key” typed patch error returned by the API.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
pkg/kube/client.go |
Wraps non-conflict, non-incompatible-server SSA patch errors with clear SSA + resource context. |
pkg/kube/client_test.go |
Adds coverage ensuring generic SSA patch errors surface the new contextual message. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Hi maintainers! 👋 Just following up on this PR — it's been 3 days with no human review yet. This fixes a confusing error message when server-side apply patch operations fail, giving users clearer context on why the patch was rejected. Happy to address any feedback or rebase if needed. Thanks for your time! |
|
Thanks for the PR. Agree this is an improvement |
- OpenSource: add PR #31981 'fix(kube): clarify server-side apply patch errors' to STATIC_MERGED and OTHER_FEATURED (alongside existing helm #31931) - Skills: bump CNCF PRs stat from 9 → 10 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
What this PR does / why we need it
Refs #31529
When a generic server-side apply patch fails, Helm currently returns the raw API error without clearly indicating that the failure happened on the server-side apply path.
This change wraps generic server-side apply patch errors with resource context and an explicit
server-side apply failedprefix, while leaving the existing incompatible-server and conflict-specific messages unchanged.What changed
patchResourceServerSide()with server-side apply contextValidation
env GOCACHE=/tmp/go-cache GOMODCACHE=/tmp/go-mod-cache go test ./pkg/kube -run 'Test(Create|PatchResourceServerSide)' -count=1