-
Notifications
You must be signed in to change notification settings - Fork 528
Implement a Validating Webhook #487
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
Comments
I would would like to take this on if no one has started yet /assign @cmluciano |
Thanks for the work on this @cmluciano! We don't currently have anything set up for docker image management, but I believe a PR to https://github.com/kubernetes/k8s.io/tree/master/k8s.gcr.io could fix that. I'm not very familiar with the process but happy to help however I can. |
Thanks! So it sounds like we might need to merge the PR I have open first and then we can add a new job there. |
Will this issue resolve the following Gateway validation use cases:
|
Can this be a regex validation check?
It should be OK (and be an error on the listener condition) for the ref to not exist when the gateway is posted.
This should be OK too (listener condition).
|
@jpeach Thanks for the feedback! |
@jpeach if multiple listeners reference the same port number, should the |
Ah I see. |
The listener field says:
And the reason is:
I think that it's OK for a gateway to squash listener specs down to some combined configuration, which means that listeners can have the same port as long as they are "compatible" (e.g. HTTP listeners on port 80 that use different hostnames).
|
If an error can be expressed by status then it should be. That gives better feedback that validation IMHO. For other constraints, perhaps the best approach is to build a validation package that can be consumed by an optional webhook, or bu controllers directly. |
@danehans Thanks for following up on this! I completely agree that we should try to include as much core validation as possible here. I think we should prioritize validation in the following way:
Of the examples you listed above, I think all but the 4th one can and should be accomplished by either CRD or webhook validation. As far as the 4th one, there's traditionally been a lot of hesitancy to implement cross resource validation in upstream Kubernetes. Beyond the additional dependencies it creates, it can break unexpectedly if both the referencing and referenced resources are being created at the same time. It would also require the webhook to have read access on all resources that could potentially be referenced. It sounds like @cmluciano could use a bit of help in getting the initial webhook implementation in place, so if anyone has extra cycles, this would be a great area to contribute. |
@robscott thanks for all the great feedback. What are your thoughts on building a validation pkg that can be used by the webhook implementation, xref #487 (comment)? |
How would that validation package be used? Would it be used for controllers to populate status if the webhook was not installed or working properly? |
@robscott that's correct. The validating webhook implementation could also use the validation pkg. |
Some things to think about are optional fields that maybe a Controller might not adopt, for instance the |
/assign |
Update: The following needs to happen now:
Once the above is completed, we need to get kubernetes/test-infra#21881 merged in. That should be it if we didn't make any mistake. |
@hbagdi I think everything listed above is complete, do you think we can close this out? I'm also happy to just pull this from the milestone if that's easier. |
The images publishing part is broken for an unknown reason. Let's pull this out because of external dependencies. |
Update: |
Although we've discussed this in a variety of previous community meetings, we didn't have an issue to track work on this. We've labeled issues that need to be covered with this webhook with
area/webhook
. Those include:This is likely not an exhaustive list, but should provide a good starting point. For simplicity, implementation of this webhook should likely live within this repo.
The text was updated successfully, but these errors were encountered: