Skip to content
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

cleanup: error is not nil but returns nil #2213

Merged
merged 1 commit into from
Jun 28, 2021
Merged

Conversation

yati1998
Copy link
Contributor

In few places, the error is not nil still it
returns nil.

Updates: #1586

Signed-off-by: Yati Padia ypadia@redhat.com

@mergify mergify bot added the cleanup label Jun 25, 2021
@@ -378,7 +378,7 @@ func checkDataPersist(pvcPath, appPath string, f *framework.Framework) error {

_, stdErr, err := execCommandInPod(f, fmt.Sprintf("echo %s > %s", data, filePath), app.Namespace, &opt)
if err != nil {
return nil
return fmt.Errorf("failed to exec command in pod: %w", err)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When you notice duplication like the above writing of data to a file, you can always create a helper function that returns a single error instead of stdErr and err. Not required for this PR, but small things like that are good cleanups too!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes sure. I will do it another PR.

@nixpanic nixpanic added priority-3 component/testing Additional test cases or CI work labels Jun 25, 2021
@nixpanic
Copy link
Member

@Mergifyio rebase

@mergify
Copy link
Contributor

mergify bot commented Jun 28, 2021

Command rebase: success

Branch has been successfully rebased

In few places the error is not nil still it
returns nil.

Updates: ceph#1586

Signed-off-by: Yati Padia <ypadia@redhat.com>
@mergify mergify bot merged commit c851b69 into ceph:devel Jun 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup component/testing Additional test cases or CI work priority-3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants