diff --git a/go.mod b/go.mod index 7d6fa34a..dc6e78f9 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/dell/gofsutil v1.14.0 github.com/dell/goiscsi v1.8.0 github.com/dell/gonvme v1.6.0 - github.com/dell/gopowerstore v1.14.1 + github.com/dell/gopowerstore v1.14.2 github.com/fsnotify/fsnotify v1.7.0 github.com/go-openapi/strfmt v0.21.3 github.com/golang/mock v1.6.0 diff --git a/go.sum b/go.sum index b22ec192..6d2f7de7 100644 --- a/go.sum +++ b/go.sum @@ -138,10 +138,8 @@ github.com/dell/goiscsi v1.8.0 h1:kocGVOdgnufc6eGpfmwP66hyhY7OVgIafaS/+uM6ogU= github.com/dell/goiscsi v1.8.0/go.mod h1:PTlQGJaGKYgia95mGwwHSBgvfOr3BfLIjGNh1HT6p+s= github.com/dell/gonvme v1.6.0 h1:Y/g0Ml8E3oSB+bqGJN1/U+V621h9t0KJeYAF5aQ7NVU= github.com/dell/gonvme v1.6.0/go.mod h1:/UgJAlR03LbPSDIK2BfhiYUlzyY7lAMJ6ao8eYab2Eg= -github.com/dell/gopowerstore v1.14.1-0.20240123112046-ec40aaf31242 h1:kR8Opp5Rr3syF5uJnmDJNe94QrUbqmLXsjTDrENFG88= -github.com/dell/gopowerstore v1.14.1-0.20240123112046-ec40aaf31242/go.mod h1:YH3SpMX2dr3ouYWWPhk5lzjip3aaVVksFOSoenRDY5w= -github.com/dell/gopowerstore v1.14.1 h1:xn9FFMLDRg42+L9OR8wOnIQfG+YGNauX9qT0vPeEfyw= -github.com/dell/gopowerstore v1.14.1/go.mod h1:YH3SpMX2dr3ouYWWPhk5lzjip3aaVVksFOSoenRDY5w= +github.com/dell/gopowerstore v1.14.2 h1:1mtQBDbMEaVtLKYj1R1z6q5TBKlI2KnGHmWOcZCvcfA= +github.com/dell/gopowerstore v1.14.2/go.mod h1:YH3SpMX2dr3ouYWWPhk5lzjip3aaVVksFOSoenRDY5w= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= diff --git a/pkg/controller/replication.go b/pkg/controller/replication.go index 61dce057..f5c1a204 100644 --- a/pkg/controller/replication.go +++ b/pkg/controller/replication.go @@ -394,7 +394,7 @@ func ExecuteAction(session *gopowerstore.ReplicationSession, pstoreClient gopowe _, err := pstoreClient.ExecuteActionOnReplicationSession(context.Background(), session.ID, action, failoverParams) if err != nil { - if apiError, ok := err.(gopowerstore.APIError); ok && !apiError.UnableToFailoverFromDestination() { + if apiError, ok := err.(gopowerstore.APIError); ok && apiError.UnableToFailoverFromDestination() { log.Error(fmt.Sprintf("Fail over: Failed to modify RS (%s) - Error (%s)", session.ID, err.Error())) return status.Errorf(codes.Internal, "Execute action: Failed to modify RS (%s) - Error (%s)", session.ID, err.Error()) } diff --git a/pkg/controller/replication_test.go b/pkg/controller/replication_test.go index a9881f51..bef7e2a6 100755 --- a/pkg/controller/replication_test.go +++ b/pkg/controller/replication_test.go @@ -925,7 +925,7 @@ var _ = ginkgo.Describe("Replication", func() { } session := gopowerstore.ReplicationSession{ID: "test", State: "Failed_Over"} - clientMock.On("ExecuteActionOnReplicationSession", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(gopowerstore.EmptyResponse(""), gopowerstore.APIError{ErrorMsg: &api.ErrorMsg{StatusCode: http.StatusNotFound}}) + clientMock.On("ExecuteActionOnReplicationSession", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(gopowerstore.EmptyResponse(""), gopowerstore.APIError{ErrorMsg: &api.ErrorMsg{StatusCode: http.StatusBadRequest}}) clientMock.On("GetReplicationSessionByLocalResourceID", mock.Anything, mock.Anything).Return(session, nil) params := make(map[string]string) diff --git a/tests/e2e/go.mod b/tests/e2e/go.mod index ca9390ce..038dc94c 100644 --- a/tests/e2e/go.mod +++ b/tests/e2e/go.mod @@ -13,7 +13,7 @@ require ( require ( github.com/dell/csi-powerstore/v2 v2.8.0 - github.com/dell/gopowerstore v1.14.1 + github.com/dell/gopowerstore v1.14.2 github.com/onsi/ginkgo/v2 v2.13.0 gopkg.in/yaml.v2 v2.4.0 k8s.io/api v0.29.0 diff --git a/tests/e2e/go.sum b/tests/e2e/go.sum index 308b3986..a79cf156 100644 --- a/tests/e2e/go.sum +++ b/tests/e2e/go.sum @@ -114,6 +114,7 @@ github.com/dell/gonvme v1.6.0 h1:Y/g0Ml8E3oSB+bqGJN1/U+V621h9t0KJeYAF5aQ7NVU= github.com/dell/gonvme v1.6.0/go.mod h1:/UgJAlR03LbPSDIK2BfhiYUlzyY7lAMJ6ao8eYab2Eg= github.com/dell/gopowerstore v1.14.1 h1:xn9FFMLDRg42+L9OR8wOnIQfG+YGNauX9qT0vPeEfyw= github.com/dell/gopowerstore v1.14.1/go.mod h1:YH3SpMX2dr3ouYWWPhk5lzjip3aaVVksFOSoenRDY5w= +github.com/dell/gopowerstore v1.14.2/go.mod h1:YH3SpMX2dr3ouYWWPhk5lzjip3aaVVksFOSoenRDY5w= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/distribution/reference v0.5.0 h1:/FUIFXtfc/x2gpa5/VGfiGLuOIdYa1t65IKK2OFGvA0=