-
Notifications
You must be signed in to change notification settings - Fork 79
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
OSD-24275: Validate machineCIDR is contained in default ingresscontro… #318
base: master
Are you sure you want to change the base?
Conversation
…ller allowedSourceRanges
@nephomaniac: This pull request references OSD-24275 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.18.0" version, but no target version was set. In response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
@nephomaniac: This pull request references OSD-24275 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.18.0" version, but no target version was set. In response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
@nephomaniac: This pull request references OSD-24275 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.18.0" version, but no target version was set. In response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
Noting that this PR currently has all the ingressController validations under the single IngressController webhook. This seemed to be the pattern? However, if we want to extend this and possibly support different validations between Classic vs HCP, etc would it then make sense to separate this out? Would we potentially want additional IngressController webhooks, and/or build time flags to indicate cluster environments such as hcp vs classic, etc? |
@nephomaniac that's definitely a good call out, and probably an improvement worth exploring. I do believe that's probably outside the scope of OSD-24275. For this card, perhaps its "good enough" to just focus on targeting Classic for the time being |
Converted this to a draft as it seems likely this should be applied to HCP as well and changes the implementation. In my limited HCP testing the cluster admin can edit the default ingressController's allowedSourceRanges excluding the machineCidr network causing the same/similar errors (ie blocking the console, etc). |
After some discussion I believe this PR can reviewed and tested for merge. The current intention is that additional Hypershift work , if desired, is to be tracked as part of a separate effort. |
Co-authored-by: Trevor Nierman <[email protected]>
Co-authored-by: Trevor Nierman <[email protected]>
…rams, and shared test flag.
Ready for review. |
/test |
@nephomaniac: The
Use In response to this:
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-sigs/prow repository. |
/retest |
Will need another dry-run or equiv webhook flag to allow additional make targets, build routines to iterate through hooks w/o requiring an actual cluster runtime env. |
/approve This looks good to me, but lets get a second opinion too |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: nephomaniac, tnierman The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@nephomaniac: This pull request references OSD-24275 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.18.0" version, but no target version was set. In response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
Just wondering offhand - what are the steps to test this? Assuming we have a cluster running with this webhook code - what things do I need to do in order to force a failure and then change to view a success? Basically - if we merge this and get this into integration/staging and we were asking QA to test this - what would they have to do/modify/create in order to test this? Not a blocker to merge this - but we'd want to know how to test this after it gets into staging to validate that it's ready to be promoted to prod at some point :) |
Thanks @iamkirkbater, For pointed tests targeted specifically at this validation I'd recommend the following minimum set of tests, somewhat similar to the unit tests:
|
It seems we implemented several functions within the webhook. Does it mean those functions will be called for each validation? Would it be any potential performance degradation? |
Thanks @bmeng, |
@nephomaniac: all tests passed! Full PR test history. Your PR dashboard. 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-sigs/prow repository. I understand the commands that are listed here. |
This PR intends to address OSD-24275 adding checks to help ensure at least one of the provided 'allowedSourceRanges' subnets contains the install-config's machineCIDR.
This includes a new role and rolebinding in the syncselectorset allowing the validation-webhook service account get() access to the install-config configmap in the kube-system namespace.
This PR attempts to include a set of unit tests intended to check different 'allowedSourceRanges' values across different machineCIDR values across update() and create() requests.
This ingresscontroller validation/check is intended to have the following limitations: