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

Fixed DeleteStorageProtectionGroup function response #407

Merged
merged 4 commits into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion service/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ const (
PGSuffix = "PG"
notFound = "not found" // error message from s.GetVolumeByID when volume not found
cannotBeFound = "Could not find" // error message from pmax when volume not found
errorNotFound = "cannot be found"
failedToValidateVolumeNameAndID = "Failed to validate combination of Volume Name and Volume ID"
IscsiTransportProtocol = "ISCSI"
FcTransportProtocol = "FC"
Expand Down Expand Up @@ -3945,7 +3946,7 @@ func (s *service) DeleteStorageProtectionGroup(ctx context.Context, req *csiext.
}
sg, err := pmaxClient.GetProtectedStorageGroup(ctx, symID, protectionGroupID)
if err != nil {
if strings.Contains(err.Error(), cannotBeFound) {
if strings.Contains(err.Error(), cannotBeFound) || strings.Contains(err.Error(), errorNotFound) {
// The protected storage group is already deleted
log.Info(fmt.Sprintf("DeleteStorageProtectionGroup: Could not find protected SG: %s on SymID: %s so assume it's already deleted", protectionGroupID, symID))
return &csiext.DeleteStorageProtectionGroupResponse{}, nil
Expand Down
11 changes: 10 additions & 1 deletion service/features/replication.feature
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,16 @@ Feature: PowerMax CSI Interface
And I call DeleteStorageProtectionGroup on "csi-rep-sg-csi-test-13-ASYNC"
Then no error was received

@srdf
@v1.6.0
Scenario: DeleteStorageProtectionGroup with no error
Given a PowerMax service
And I call RDF enabled CreateVolume "volume1" in namespace "csi-test", mode "ASYNC" and RDFGNo 13
And a valid CreateVolumeResponse is returned
Then I induce error "GetProtectedStorageGroupError"
And I call DeleteStorageProtectionGroup on "csi-rep-sg-csi-test-13-ASYNC"
Then no error was received

@srdf
@v1.6.0
Scenario Outline: DeleteStorageProtectionGroup with different error
Expand All @@ -216,7 +226,6 @@ Feature: PowerMax CSI Interface
Then the error contains <errormsg>
Examples:
| induced | errormsg |
| "GetProtectedStorageGroupError" | "cannot be found" |
| "RDFGroupHasPairError" | "it is not empty" |
| "DeleteStorageGroupError" | "Error deleting storage group" |
| "FetchResponseError" | "GetProtectedStorageGroup failed" |
Expand Down
Loading