Skip to content

Commit

Permalink
refactor: remove extra code
Browse files Browse the repository at this point in the history
Signed-off-by: Shivanjan Chakravorty <[email protected]>
  • Loading branch information
Glitchfix committed Aug 10, 2023
1 parent 2bdbb1e commit 048df5b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 21 deletions.
9 changes: 2 additions & 7 deletions csi/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -1155,7 +1155,7 @@ func (s *OsdCsiServer) deleteCloudBackup(
backupID := req.GetSnapshotId()

// Delete snapshot
resp, err := cloudBackupClient.Delete(ctx, &api.SdkCloudBackupDeleteRequest{
_, err = cloudBackupClient.Delete(ctx, &api.SdkCloudBackupDeleteRequest{
BackupId: backupID,
CredentialId: credentialID,
})
Expand All @@ -1166,12 +1166,7 @@ func (s *OsdCsiServer) deleteCloudBackup(
}
return nil, status.Errorf(codes.Aborted, "failed to delete cloud snapshot: %v", err)
}

if resp != nil {
return &csi.DeleteSnapshotResponse{}, nil
}

return nil, status.Errorf(codes.Aborted, "unexpected error occured: %v", err)
return &csi.DeleteSnapshotResponse{}, nil
}

// ListSnapshots lists all snapshots in a cluster.
Expand Down
14 changes: 0 additions & 14 deletions csi/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3652,20 +3652,6 @@ func TestOsdCsiServer_DeleteCloudSnapshot(t *testing.T) {
nil,
true,
},
{
"volume id not found while deleting",
"delete-notfound",
"valid-cred",
nil,
true,
},
{
"unexpected error",
"unexpected-error",
"valid-cred",
&csi.DeleteSnapshotResponse{},
true,
},
{
"deletion completes without any error",
"ok",
Expand Down

0 comments on commit 048df5b

Please sign in to comment.