From 14e014ac06d40b53008c7cbb3c8a30596f3b07bf Mon Sep 17 00:00:00 2001 From: Davanum Srinivas Date: Thu, 20 Jul 2017 13:49:57 -0400 Subject: [PATCH] Better message if we dont find appropriate BlockStorage API With latest devstack, v1 and v2 are DEPRECATED and v3 is marked as CURRENT. So we fail to attach the disk, the error message is shown when one does "kubectl describe pod" but the operator has to dig into find the problem. So log a better message if we can't find the appropriate version of the API that we support with an explicit error message that the operator can see how to fix the situation. Note support for v3 block storage API is being added to gophercloud and will take a bit of time before we can support it. --- pkg/cloudprovider/providers/openstack/openstack.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/cloudprovider/providers/openstack/openstack.go b/pkg/cloudprovider/providers/openstack/openstack.go index 7f9ebc78049..b1761682165 100644 --- a/pkg/cloudprovider/providers/openstack/openstack.go +++ b/pkg/cloudprovider/providers/openstack/openstack.go @@ -657,8 +657,10 @@ func (os *OpenStack) volumeService(forceVersion string) (volumeService, error) { if autodetectedVersion := doBsApiVersionAutodetect(availableApiVersions); autodetectedVersion != "" { return os.volumeService(autodetectedVersion) } else { - // Nothing suitable found, failed autodetection - return nil, errors.New("BS API version autodetection failed.") + // Nothing suitable found, failed autodetection, just exit with appropriate message + err_txt := "BlockStorage API version autodetection failed. " + + "Please set it explicitly in cloud.conf in section [BlockStorage] with key `bs-version`" + return nil, errors.New(err_txt) } default: