Skip to content

Commit

Permalink
Pass new user Error (#13)
Browse files Browse the repository at this point in the history
* Pass new user Error

* Bump library version
  • Loading branch information
prankulmahajan committed Nov 22, 2021
1 parent 417312d commit 8c147f8
Show file tree
Hide file tree
Showing 17 changed files with 113 additions and 22 deletions.
5 changes: 3 additions & 2 deletions go.mod
Expand Up @@ -3,8 +3,9 @@ module github.com/kubernetes-sigs/ibm-vpc-block-csi-driver
go 1.16

require (
github.com/IBM/ibm-csi-common v1.0.0-beta6
github.com/IBM/ibmcloud-volume-interface v1.0.0-beta7
github.com/IBM/ibm-csi-common v1.0.0-beta9
github.com/IBM/ibmcloud-volume-interface v1.0.0-beta8
github.com/IBM/ibmcloud-volume-vpc v1.0.0-beta12
github.com/container-storage-interface/spec v1.3.0
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b
github.com/google/uuid v1.1.2
Expand Down
12 changes: 6 additions & 6 deletions go.sum
Expand Up @@ -4,12 +4,12 @@ github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/IBM-Cloud/ibm-cloud-cli-sdk v0.6.7 h1:eHgfQl6IeSmzWUyiSi13CvoFYsovoyqWlpHX0pa9J54=
github.com/IBM-Cloud/ibm-cloud-cli-sdk v0.6.7/go.mod h1:RiUvKuHKTBmBApDMUQzBL14pQUGKcx/IioKQPIcRQjs=
github.com/IBM/ibm-csi-common v1.0.0-beta6 h1:FTZNuQjVmYNtVm7mlbuC2Sg45fSTEz7s4iSqnRHLZhg=
github.com/IBM/ibm-csi-common v1.0.0-beta6/go.mod h1:DswvI7yUVfsLiFYQ/ADjrSqSMijujk3CZpFSbwolQQQ=
github.com/IBM/ibmcloud-volume-interface v1.0.0-beta7 h1:cl1situtbkJwEsRDw1CW2KpJkmznmjzhWWnSPH3TzvM=
github.com/IBM/ibmcloud-volume-interface v1.0.0-beta7/go.mod h1:2LxqkERml3eBxfRkQniuiRmKkAnl5tfC0ttlP2gupJM=
github.com/IBM/ibmcloud-volume-vpc v1.0.0-beta11 h1:C3xhQZocc2zhmhyJlB2bVSbowy2sSIgsByBADTk4eIc=
github.com/IBM/ibmcloud-volume-vpc v1.0.0-beta11/go.mod h1:W7x7R58nPNBFO2HwebpDSkbCOYMkdsxKW1+7bA7r+Uk=
github.com/IBM/ibm-csi-common v1.0.0-beta9 h1:gMn6tow1f6TohCY3QEwNDXCScGC0qiZc1yL9SaaClKw=
github.com/IBM/ibm-csi-common v1.0.0-beta9/go.mod h1:ED7Dwg3MjYyHu5cQ0TlLJ3eXwm3Kb0nQvk8vH1kVbbM=
github.com/IBM/ibmcloud-volume-interface v1.0.0-beta8 h1:0oCBQidejAlLI5f5PlBHIytArhJI1aEOBCCOMoxNOPs=
github.com/IBM/ibmcloud-volume-interface v1.0.0-beta8/go.mod h1:2LxqkERml3eBxfRkQniuiRmKkAnl5tfC0ttlP2gupJM=
github.com/IBM/ibmcloud-volume-vpc v1.0.0-beta12 h1:Hfw7XvHpexffDfvD50wFJCwUmhKeVUlKEFi7JMcSSZI=
github.com/IBM/ibmcloud-volume-vpc v1.0.0-beta12/go.mod h1:MEyNF/zxHl2Zw/kBy7qykGPt8X+U+kDEJV1kimrvCbs=
github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ=
github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
Expand Down
8 changes: 8 additions & 0 deletions pkg/ibmcsidriver/controller.go
Expand Up @@ -27,6 +27,8 @@ import (
"github.com/IBM/ibm-csi-common/pkg/utils"
"github.com/IBM/ibmcloud-volume-interface/lib/provider"
providerError "github.com/IBM/ibmcloud-volume-interface/lib/utils"
utilReasonCode "github.com/IBM/ibmcloud-volume-interface/lib/utils/reasoncode"
userError "github.com/IBM/ibmcloud-volume-vpc/common/messages"
csi "github.com/container-storage-interface/spec/lib/go/csi"

"go.uber.org/zap"
Expand Down Expand Up @@ -105,6 +107,12 @@ func (csiCS *CSIControllerServer) CreateVolume(ctx context.Context, req *csi.Cre
// Validate if volume Already Exists
session, err := csiCS.CSIProvider.GetProviderSession(ctx, ctxLogger)
if err != nil {
if userError.GetUserErrorCode(err) == string(utilReasonCode.EndpointNotReachable) {
return nil, commonError.GetCSIError(ctxLogger, commonError.EndpointNotReachable, requestID, err)
}
if userError.GetUserErrorCode(err) == string(utilReasonCode.Timeout) {
return nil, commonError.GetCSIError(ctxLogger, commonError.Timeout, requestID, err)
}
return nil, commonError.GetCSIError(ctxLogger, commonError.InternalError, requestID, err)
}

Expand Down
18 changes: 18 additions & 0 deletions vendor/github.com/IBM/ibm-csi-common/pkg/messages/messages_en.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 11 additions & 2 deletions vendor/github.com/IBM/ibmcloud-volume-vpc/iks/provider/provider.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions vendor/modules.txt
Expand Up @@ -2,7 +2,7 @@
github.com/BurntSushi/toml
# github.com/IBM-Cloud/ibm-cloud-cli-sdk v0.6.7
github.com/IBM-Cloud/ibm-cloud-cli-sdk/common/rest
# github.com/IBM/ibm-csi-common v1.0.0-beta6
# github.com/IBM/ibm-csi-common v1.0.0-beta9
## explicit
github.com/IBM/ibm-csi-common/pkg/ibmcloudprovider
github.com/IBM/ibm-csi-common/pkg/messages
Expand All @@ -13,7 +13,7 @@ github.com/IBM/ibm-csi-common/pkg/utils
github.com/IBM/ibm-csi-common/pkg/utils/grpc-client
github.com/IBM/ibm-csi-common/pkg/watcher
github.com/IBM/ibm-csi-common/provider
# github.com/IBM/ibmcloud-volume-interface v1.0.0-beta7
# github.com/IBM/ibmcloud-volume-interface v1.0.0-beta8
## explicit
github.com/IBM/ibmcloud-volume-interface/config
github.com/IBM/ibmcloud-volume-interface/lib/metrics
Expand All @@ -24,7 +24,8 @@ github.com/IBM/ibmcloud-volume-interface/lib/utils/reasoncode
github.com/IBM/ibmcloud-volume-interface/provider/auth
github.com/IBM/ibmcloud-volume-interface/provider/iam
github.com/IBM/ibmcloud-volume-interface/provider/local
# github.com/IBM/ibmcloud-volume-vpc v1.0.0-beta11
# github.com/IBM/ibmcloud-volume-vpc v1.0.0-beta12
## explicit
github.com/IBM/ibmcloud-volume-vpc/block/provider
github.com/IBM/ibmcloud-volume-vpc/block/utils
github.com/IBM/ibmcloud-volume-vpc/block/vpcconfig
Expand Down

0 comments on commit 8c147f8

Please sign in to comment.