Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Support primary network #36
Support primary network #36
Changes from all commits
bc937da
6ba3618
3b5970b
fba614f
71dfd6c
d008090
bdabec2
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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 really dislike the fact this returns 3 things.
And the fact we use this
response
parameter just to indicate something that IMO looks like an error is very puzzling to me.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 don't like it either, but I was trying to maintain the original behaviour where is returning
NAD not found, will hang on scheduler
if there is no nad for the NSE, we can just returnnil, nil
but logging it and the webhook response will be "carry on"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 suggest you return a new error type like "NoNadIgnoreReqest" and expect that case outside of
ensureIPAMClaimRefAtNetworkSelectionElements
, returning the AdmissionAllowedon hasChangedNetworkSelectionElements function:
then outside of it:
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.
Puff I think this is overkill just to return something at the webhook success, I want to know if returning that specific string is really necessary or logging it is enough.
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.
hm, returning bool, error also makes me frown...
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.
ok, simplified since we don't care about th emssage at webhook.Allowed
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.
no sure you saw it and chose to ignore it, or just didn't see it.
Can we try to improve this function's signature ?
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.
What the issue with that ? is a function that try to update a map and return if the map was updated or not.
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.
you can do the exact same thing with just error, or returning the map and letting the client understand if it changed or not.
if your function does "update a map and return if the map was updated or not" your function is doing 2 things. The function should do one. Update the map.
We can improve it later on if this is the only item under question.
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.
openned an issue to simplify things later on #63