-
Notifications
You must be signed in to change notification settings - Fork 96
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
Sanity check if the image name has a colon #922
base: master
Are you sure you want to change the base?
Conversation
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.
Overall this LGTM, thanks for addressing this 👍
Would you mind adding a test for IsLoggingEnabled
here to avoid any regressions in the future?
if len(split_result) > 1 { | ||
version = split_result[1] | ||
} else { | ||
return false |
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.
Should we add a log line here or something? I'm just thinking that if this condition is hit (no semi-colon in the image name), how would the end user know?
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 have tried to add the log line before, but it seems that a parameter that defines the logger needs to be passed to this function. However, this parameter is currently not available in this function.
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 think it would be sufficient to add an else branch here that lets the user know that logging is not enabled.
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.
Okay, I have added it in the latest commit.
Thanks for your response. We have added a unit test in our latest commit. |
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 updates. Just a few comments below. This is looking good.
name: "verify image name without colon", | ||
cluster: clusterBuilder.WithImage(customImageName).Cluster(), | ||
imageName: customImageName, | ||
}, |
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 think we're missing the case where logging is enabled here.
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.
Yep, I have added it.
if len(split_result) > 1 { | ||
version = split_result[1] | ||
} else { | ||
return false |
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 think it would be sufficient to add an else branch here that lets the user know that logging is not enabled.
@pseudomuto Could you review this so that it can be merged? I think this is a pretty straight-forward fix |
fix #918
We fixed the issue by adding sanity check to examine whether a colon is contained in the image name in
IsLoggingAPIEnabled
function. If there is no colon in image name, we will not retrieve index 1 and will directly return false.Checklist