-
Notifications
You must be signed in to change notification settings - Fork 765
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set Forbidden as the response status reason #1692
Conversation
7a15dd5
to
5f12afd
Compare
Thanks for the PR! I think this makes sense, but if raises a few questions: Why does controller-runtime not currently work this way? Do we run the risk of breaking something else by changing this? Is it possible that this should be fixed at the controller-runtime level? For this PR, I'm mainly concerned about the second question. |
it's a bug in controller-runtime, fix proposed in kubernetes-sigs/controller-runtime#1539 |
Hi @maxsmythe @liggitt! Thanks, I was unaware of that proposed fix in kubernetes-sigs/controller-runtime#1539 which makes sense to me. However, it seems to me that there's no agreement if it should go in which will delay things a bit.
Possibly:
IMO, I think it still makes sense to address this in `gatekeeper because users on current versions or earlier will still benefit from it. Let me know what do you think. I'll propose a new change that's in line with the above PR and safe for future updates. |
16f9867
to
3fcac68
Compare
Signed-off-by: Filipe Regadas <[email protected]>
3fcac68
to
2984707
Compare
Signed-off-by: Filipe Regadas <[email protected]>
2984707
to
90f8a48
Compare
Thanks @liggitt for the context! Knowing that it's a bug in controller-runtime, it sounds like we're probably safe to fix it here. Chesterton's fence is ready for removal ;) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Codecov Report
@@ Coverage Diff @@
## master #1692 +/- ##
==========================================
+ Coverage 51.81% 51.93% +0.11%
==========================================
Files 98 98
Lines 8711 8718 +7
==========================================
+ Hits 4514 4528 +14
+ Misses 3833 3831 -2
+ Partials 364 359 -5
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* Set Forbidden as the response status reason Signed-off-by: Filipe Regadas <[email protected]> * fixup! Set Forbidden as the response status reason Signed-off-by: Filipe Regadas <[email protected]> Co-authored-by: Rita Zhang <[email protected]> Signed-off-by: Priya [email protected] <[email protected]>
Hi @ritazh @priyamshet; quick question: In which version are you aiming to have this in? currently I'm running a fork of gatekeeper because this change is a blocker for me. Just want to understand for how long I need to keep it 😄 Thanks. |
@regadas This commit should be included in the upcoming release v3.8.0 in the next couple of weeks. Thanks for your patience! |
What this PR does / why we need it:
Recently while integrating
gatekeeper
I noticed that a denied admission webook response will look somewhat like this:Message
andReason
kinda have the same info.I guess this is generally ok! However, if one is using
"k8s.io/apimachinery/pkg/api/errors"
to determine the type of error we are out of luck since it relies on theReason
property.Given the above example:
I suggest a small change in the
StatusError
and giveReason
the proper description keepingMessage
as the human-readable description of this operation.Fixes #1693