-
Notifications
You must be signed in to change notification settings - Fork 541
[WIP] OCPBUGS-55192: Add IngressController .spec.domain validation #2308
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
base: master
Are you sure you want to change the base?
[WIP] OCPBUGS-55192: Add IngressController .spec.domain validation #2308
Conversation
Hello @grzpiotrowski! Some important instructions when contributing to openshift/api: |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: grzpiotrowski The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@grzpiotrowski: This pull request references Jira Issue OCPBUGS-55192, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. 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. |
2e10452
to
a538d6c
Compare
This commit fixes OCPBUGS-55192. https://issues.redhat.com/browse/OCPBUGS-55192 Add ratcheting validation of the .spec.domain field of ingress controller. Domain must consist of lowercase alphanumeric characters '-' or '.', and each label must start and end with an alphanumeric character. * operator/v1/types_ingress.go (IngressControllerSpec): Add ratcheting validation of the Domain field. * operator/v1/tests/ingresscontrollers.operator.openshift.io/AAA_ungated.yaml Add test cases for the ingress controller .spec.domain field validation
a538d6c
to
d5e7974
Compare
@grzpiotrowski: The following test failed, say
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 fixes OCPBUGS-55192.
Add ratcheting validation of the .spec.domain field of ingress controller.
Domain must consist of lowercase alphanumeric characters '-' or '.', and each label must start and end with an alphanumeric character.
Previously, the user could configure the .spec.domain field incorrectly which could result in the router pods entering a
CrashLoopBackOff
state immediately upon creation witherror: invalid canonical hostname: [...]
.Opted not to add the max length validation
// +kubebuilder:validation:MaxLength=253
as it could be slightly misleading, because even if.spec.domain
does not exceed that 253 characters limit, we could end up with an invalid canonical hostname error as this is constructed from the router name and the IC domain, which length could not be predicted here.