Skip to content
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

Validate spec.ingress.http.path #313

Merged
merged 1 commit into from
Feb 22, 2021
Merged

Validate spec.ingress.http.path #313

merged 1 commit into from
Feb 22, 2021

Conversation

k0da
Copy link
Collaborator

@k0da k0da commented Feb 22, 2021

Require .spec.ingress.http.path as it is required for gslb to function.
If broken Gslb submitted, it will be rejected by openapi v3 validation.
Same will happen when using Ingress annotations, we won't create broken
Gslb object but log an error message instead.

Signed-off-by: Dinar Valeev [email protected]

@k0da
Copy link
Collaborator Author

k0da commented Feb 22, 2021

@ytsarev @somaritane - as we discussed.

@kuritka It is cheap to cut off broken boject by api validation and not coplicate depresolver with essential data requirement. As for Ingress: we'll catch errors by same api validator, and throw an error, so broken object won't be created and controller won't observe it.

@kuritka
Copy link
Collaborator

kuritka commented Feb 22, 2021

If app doesn't start because http and http.paths are required, then all is ok.

kuritka
kuritka previously approved these changes Feb 22, 2021
@k0da
Copy link
Collaborator Author

k0da commented Feb 22, 2021

Copy link
Contributor

@somaritane somaritane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, just few comments.

Require .spec.ingress.http.path as it is required for gslb to function.
If broken Gslb submitted, it will be rejected by openapi v3 validation.
Same will happen when using Ingress annotations, we won't create broken
Gslb object but log an error message instead.

Signed-off-by: Dinar Valeev <[email protected]>
Copy link
Contributor

@somaritane somaritane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

Copy link
Member

@ytsarev ytsarev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good just some comment on possible commented out config leftover

spec:
rules:
- host: notfound.cloud.example.com
#http:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is it for?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a quick way to make it invalid for gslb controller, but keeping it visible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants