Skip to content

Conversation

gaurav-splunk
Copy link
Collaborator

No description provided.

Comment on lines -61 to -63
if err != nil {
return result, err
}
Copy link
Contributor

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.

Copy link
Collaborator Author

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.

Copy link
Contributor

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.

Copy link
Contributor

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?

Copy link
Collaborator Author

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
Copy link
Contributor

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.

Copy link
Collaborator Author

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.

Copy link
Collaborator

@akondur akondur left a 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 {
Copy link
Collaborator Author

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.

@smohan-splunk smohan-splunk merged commit bfe8d45 into develop Dec 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants