-
Notifications
You must be signed in to change notification settings - Fork 326
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
L7 intentions #352
L7 intentions #352
Conversation
37d7c9e
to
de6bdbc
Compare
- This ensures we dont have to necessarily write failing tests every time we add a field
24dc5d4
to
b8a87a1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! A couple of comments, but nothing blocking.
if in == nil { | ||
return nil | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we probably don't need this since a nil array is an empty array.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch!!
if invalidPathPrefix(in.PathExact) { | ||
errs = append(errs, field.Invalid(path.Child("pathExact"), in.PathExact, `must begin with a '/'`)) | ||
} | ||
return errs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you think we need to validate that a valid HTTP method was provided? This is not a blocker by any means, could be added at a later time once we have more docs and stuff from consul.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was wondering the same thing. I wasn't sure if casing was a problem or if wild cards were supported which I why I punted on that for now. If the exhaustive list of methods is GET, PUT, POST, PATCH & DELETE (do you know if we support CONNECT, OPTIONS, TRACE and HEAD)??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PS: i had to look up MDN to get the exhaustive list of http methods 😛
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, fair enough! Definitely makes sense to punt! Haha, I don't even know what is MDN 🤯
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review @ishustava 💥
Changes proposed in this PR:
Add support for L7 intentions
How I've tested this PR:
Local tests.
Pending: Testing via helm
How I expect reviewers to test this PR:
This PR is mostly just an update to the existing struct. At this point, there is not enough documentation for the fields but that will be updated when consul updates docs for service intentions as config entries.