Don't use experimental versions.
diff --git a/openstack/utils/choose_version.go b/openstack/utils/choose_version.go
index e1ddf6b..6dbb8ac 100644
--- a/openstack/utils/choose_version.go
+++ b/openstack/utils/choose_version.go
@@ -2,6 +2,7 @@
import (
"fmt"
+ "strings"
"github.com/racker/perigee"
)
@@ -12,6 +13,12 @@
Priority int
}
+var goodStatus = map[string]bool{
+ "current": true,
+ "supported": true,
+ "stable": true,
+}
+
// ChooseVersion queries the base endpoint of a API to choose the most recent non-experimental alternative from a service's
// published versions.
// It returns the highest-Priority Version among the alternatives that are provided, as well as its corresponding endpoint.
@@ -54,7 +61,7 @@
var endpoint string
for _, value := range resp.Versions.Values {
- if matching, ok := byID[value.ID]; ok {
+ if matching, ok := byID[value.ID]; ok && goodStatus[strings.ToLower(value.Status)] {
if highest == nil || matching.Priority > highest.Priority {
highest = matching