-
Notifications
You must be signed in to change notification settings - Fork 123
CSPL-588: This PR improves code coverage for clustermaster specific code #180
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
Conversation
if err != nil { | ||
return result, err | ||
} |
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.
Any reason we are removing this error check? This was introduced to handle the case when somebody accidentally deletes the secret object consisting the S4 keys.
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 knew this would come up :). If you look at the code for AreRemoteVolumeKeysChanged
, there is no case in that function where we are returning true
and also returning err
as well.
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 point Gaurav. That was a miss i guess. In that case, we need to handle it differently such that we still return for that case.
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.
Something like explicitly checking the return value of AreRemoteVolumeKeysChanged
and when it is false, checking if it has thrown as err
?
Am I right in saying ApplyClusterMaster
shouldn't proceed if smartstore was configured but the secret object is not accessible anymore?
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.
yes, you are right! we should error out in that case. So in short, we need to take care of case where it returns false with error. Let me fix it and push a change again.
*ss.Spec.Replicas = ss.Status.ReadyReplicas | ||
objects := []runtime.Object{ss, pod} | ||
client.AddObjects(objects) | ||
current.Spec.CommonSplunkSpec.Mock = 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 we are in the flow of removing the mock flag, and fixing those dependencies? In my earlier changes, I removed the mock dependencies, and that even created some holes in the coverage, so I raised a couple of stories to fix them formally.
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.
As discussed this thing touches MC code, hence I left it as is as it might require some more code changes on MC side.
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!
} | ||
|
||
// This is to take care of case where AreRemoteVolumeKeysChanged returns an error if it returns false. | ||
if err != 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.
This should take care of above comment.
No description provided.