kubernetes-sigs / kubernetes-sigs/controller-runtime

High-level validating webhooks ignore the apierrors status info

Open
#1,046 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

kind/bug lifecycle/frozen priority/important-longterm
Dominant language
Go
Stars
3k
Forks
1.3k
Avg merge
2d 5h
Merged PRs (30d)
14

Description

It's a bit confusing that if you return something like apierrors.NewInvalid from the high-level Validator interface, we ignore the error code in that StatusError and always use 403. It'll be a breaking change, but we should probably have some mechanism for using the error code that the user requests in the high-level interface. We'll also want to make sure that the apiserver continues to treat the error the same -- IIRC it does funky stuff to the structured message for certain codes.

/kind bug
/priority important-longterm

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how the high-level Validator interface handles returned apierrors.StatusError values and how the apiserver treats the resulting status codes and structured messages. Done means the interface can use the requested error code while preserving the apiserver's existing behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
api
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.