Skip to content
This repository was archived by the owner on Mar 22, 2018. It is now read-only.

Commit 56013e6

Browse files
author
Kubernetes Submit Queue
authored
Merge pull request #49318 from dims/bail-on-block-storage-api-detection
Automatic merge from submit-queue (batch tested with PRs 49081, 49318, 49219, 48989, 48486) Better message if we dont find appropriate BlockStorage API **What this PR does / why we need it**: 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. **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes # **Special notes for your reviewer**: **Release note**: ```release-note NONE ```
2 parents 2b8855a + 6d99346 commit 56013e6

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

pkg/cloudprovider/providers/openstack/openstack.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -652,8 +652,10 @@ func (os *OpenStack) volumeService(forceVersion string) (volumeService, error) {
652652
if autodetectedVersion := doBsApiVersionAutodetect(availableApiVersions); autodetectedVersion != "" {
653653
return os.volumeService(autodetectedVersion)
654654
} else {
655-
// Nothing suitable found, failed autodetection
656-
return nil, errors.New("BS API version autodetection failed.")
655+
// Nothing suitable found, failed autodetection, just exit with appropriate message
656+
err_txt := "BlockStorage API version autodetection failed. " +
657+
"Please set it explicitly in cloud.conf in section [BlockStorage] with key `bs-version`"
658+
return nil, errors.New(err_txt)
657659
}
658660

659661
default:

0 commit comments

Comments
 (0)