managed-cluster-validating-webhooks
managed-cluster-validating-webhooks copied to clipboard
OSD-24275: Validate machineCIDR is contained in default ingresscontro…
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:
- Should only apply to Create, and/or Update request operations
- Should only apply to update/create requests for the "default" ingresscontroller (namespace: openshift-ingress-operator)
- This validation should not apply to requests which do not contain the "allowedSourceRanges" param/attr, or contain an empty value in the request. (Note: This does not prevent users from removing the 'allowedSourceRanges' values from an ingress controller which can result in a controller get stuck in progressing state).
- At this time this webhook is not enabled for Hypershift, and is enabled for Classic only.