-
Notifications
You must be signed in to change notification settings - Fork 24
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
planner: add functions to check if smbshares are compatible #260
planner: add functions to check if smbshares are compatible #260
Conversation
To use the the ErrorContains function. Signed-off-by: John Mulligan <[email protected]>
Compatible SmbShares are shares that can be hosted by one smbd instance. In other words, compatible share can be grouped together. This function is not yet used but will be once we have the ability to specify grouped smbshares. Signed-off-by: John Mulligan <[email protected]>
Signed-off-by: John Mulligan <[email protected]>
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.
LGTM.
Minor comment on pass-by-value vs pass-by-pointer.
} | ||
|
||
func incompatible( | ||
current, existing InstanceConfiguration, |
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 prefer using pass-by-pointer in such cases. Although InstanceConfiguration
is just a 4-pointers tuple now, it may get bigger in the future causing inefficient pass-by-value.
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.
This is a case where I personally feel semantics > performance UNTIL we profile and discover this is leading to a measurable performance issue. I want the "read only" nature of this comparison to be apparent.
On top of that https://codewithyury.com/golang-pass-by-pointer-vs-pass-by-value/ notes that pass by value is not always slower. I one read a longer and more thorough article saying the same but I can't find it right now.
// CheckCompatible returns an error if the instance configurations are | ||
// not compatible with each other. A compatible instance is one that | ||
// can share the same smbd. | ||
func CheckCompatible(current, existing InstanceConfiguration) error { |
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.
Same as previous comment: prefer pass-by-pointer.
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.
lgtm
Compatible SmbShares are shares that can be hosted by one smbd instance.
In other words, compatible share can be grouped together. This function
is not yet used but will be once we have the ability to specify grouped
smbshares.
Adds a newer version of testify and matching unit tests.