controller-runtime
controller-runtime copied to clipboard
:sparkles: feat: new features about support warning with webhook
Signed-off-by: STRRL [email protected]
close https://github.com/kubernetes-sigs/controller-runtime/issues/1896
Two new interfaces ValidatorWarn
and CustomValidatorWarn
, for support warnings in validating webhooks.
Hi @STRRL. Thanks for your PR.
I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test
on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.
Once the patch is verified, the new status will be reflected by the ok-to-test
label.
I understand the commands that are listed here.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
/ok-to-test
/test pull-controller-runtime-test-master
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: STRRL
Once this PR has been reviewed and has the lgtm label, please assign pwittrock for approval by writing /assign @pwittrock
in a comment. For more information see the Kubernetes Code Review Process.
The full list of commands accepted by this bot can be found here.
Approvers can indicate their approval by writing /approve
in a comment
Approvers can cancel approval by writing /approve cancel
in a comment
happy to see new progress on this PR; I have fixed the test cases and linter :)
PTAL @camilamacedo86
Would this implementation effectively supersede the existing high-level validator interfaces? At first glance, it seems like it has identical functionality except that it can also return warnings?
I worry about maintaining both (almost identical) implementations over time.
I commented over on the issue, but I think we could use the existing interfaces and have a custom error type that includes the warnings like you suggest.
I worry about maintaining both (almost identical) implementations over time. I commented over on the issue, but I think we could use the existing interfaces and have a custom error type that includes the warnings like you suggest.
I agree. We should definitely avoid introducing a third set of interfaces. I'll continue on the issue. Let's keep the discussion there for now to avoid concurrent threads.
just mention the discussion result: we prefer to break the API instead of introducing a new type called ErrorWithWarnings
, ref: https://github.com/kubernetes-sigs/controller-runtime/issues/1896#issuecomment-1327672092
Hi! I have updated this PR with these changes:
- stop using
goerrors "errors"
in import - move
error
as the last value returned by methods, eg.ValidateCreate() ( err error, warnings []string)
->ValidateCreate() (warnings []string, err error)
Hi! I have updated this PR with these changes:
- stop using
goerrors "errors"
in import- move
error
as the last value returned by methods, eg.ValidateCreate() ( err error, warnings []string)
->ValidateCreate() (warnings []string, err error)
/cc @invidian @sbueringer
Thx sorry for the late response, will review soon
Thanks for putting this PR together @STRRL 👏 also interested into this.
Agree with @sbueringer et al. here.
@STRRL do you have time to address the findings above?
@STRRL do you have time to address the findings above?
yeah! I would follow up!
/retest
resolved the conflicts
/retest
ptal @sbueringer :heart:
Updated! PTAL @sbueringer :heart:
Thank you!
/lgtm
/assign @vincepri @alvaroaleman
/hold
There are merge commits in this PR, can we remove them please?
/hold
There are merge commits in this PR, can we remove them please?
Sure, I would rebase them.
/hold There are merge commits in this PR, can we remove them please?
Sure, I would rebase them.
Done
/cc @vincepri @sbueringer
PTAL
@STRRL: The following test failed, say /retest
to rerun all failed tests or /retest-required
to rerun all mandatory failed tests:
Test name | Commit | Details | Required | Rerun command |
---|---|---|---|---|
pull-controller-runtime-apidiff | b2a955209912f188758a1ae2281f8cea691a6126 | link | false | /test pull-controller-runtime-apidiff |
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.
Looks good thx!
@STRRL can you please squash the commits?
/lgtm
/assign @vincepri
/approve
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: STRRL, vincepri
The full list of commands accepted by this bot can be found here.
The pull request process is described here
- ~~OWNERS~~ [vincepri]
Approvers can indicate their approval by writing /approve
in a comment
Approvers can cancel approval by writing /approve cancel
in a comment
/hold cancel