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

Eskip check fails on empty URL on network backend. #2524

Merged
merged 4 commits into from
Aug 18, 2023
Merged

Eskip check fails on empty URL on network backend. #2524

merged 4 commits into from
Aug 18, 2023

Conversation

xavivars
Copy link
Contributor

@xavivars xavivars commented Aug 18, 2023

This change to eskip check validates no routes have empty backend.

"empty url" error falls between the "pure syntactical" checks that eskip check runs at validation time and the "route-specific setup-dependant" checks that skipper does at runtime (making sure, for example, that all predicates / filters exist, etc).

While this is not a fatal error, and loading the skip files in skipper works (only the specific route gets discarded), we think having this validation in eskip check is a better approach, because this is an error that is known in advance (no URL can be empty) and we could not find a reason we'd ever want to, on purpose, push a non-working route to production.

Fixes #2523

Signed-off-by: Xavi Ivars <[email protected]>
@xavivars xavivars changed the title Empty backend. Fixes #2523 Empty backend. Aug 18, 2023
@xavivars xavivars changed the title Empty backend. Eskip check fails on empty URL on network backend. Aug 18, 2023
@AlexanderYastrebov
Copy link
Member

AlexanderYastrebov commented Aug 18, 2023

Thank you.
I think we can have it like you propose (after comments are addressed).

In general I think we should make backend validation (both network and loadbalanced) more strict during eskip parsing (reject empty values, non-parseable urls, urls with non-empty path, etc) - then k8s dataclient and webhook would benefit from it as well. @MustafaSaber is working on validation topic, see related #1618

Signed-off-by: Xavi Ivars <[email protected]>
Signed-off-by: Xavi Ivars <[email protected]>
Signed-off-by: Xavi Ivars <[email protected]>
@xavivars
Copy link
Contributor Author

Thanks for the quick review!

I think I've addressed all your comments now.

And I agree: stricter backend validation would be great.

@AlexanderYastrebov
Copy link
Member

Thank you.

@AlexanderYastrebov
Copy link
Member

👍

1 similar comment
@szuecs
Copy link
Member

szuecs commented Aug 18, 2023

👍

@szuecs szuecs merged commit e5e23a8 into zalando:master Aug 18, 2023
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.

eskip check don't fail when backend is empty string
3 participants