Merge pull request #58226 from lpabon/b58092

Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

csi: Fix versioning error message

**What this PR does / why we need it**:
Incorrect error message

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #58092
pull/6/head
Kubernetes Submit Queue 2018-01-19 13:52:54 -08:00 committed by GitHub
commit 5a44d2ccac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -93,6 +93,7 @@ func (c *csiDriverClient) assertConnection() error {
// If version is not supported, the assertion fails with an error.
// This test should be done early during the storage operation flow to avoid
// unnecessary calls later.
// `ver` argument holds the expected supported version.
func (c *csiDriverClient) AssertSupportedVersion(ctx grpctx.Context, ver *csipb.Version) error {
if c.versionAsserted {
if !c.versionSupported {
@ -129,7 +130,10 @@ func (c *csiDriverClient) AssertSupportedVersion(ctx grpctx.Context, ver *csipb.
c.versionSupported = supported
if !supported {
return fmt.Errorf("version %s not supported", verToStr(ver))
return fmt.Errorf(
"CSI Driver does not support version %s. Instead it supports versions %s",
verToStr(ver),
versToStr(vers))
}
glog.V(4).Info(log("version %s supported", verToStr(ver)))