-
Notifications
You must be signed in to change notification settings - Fork 510
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix BareMetalV1 version #2486
Fix BareMetalV1 version #2486
Conversation
openstack/client.go
Outdated
@@ -363,7 +363,11 @@ func initClientOpts(client *gophercloud.ProviderClient, eo gophercloud.EndpointO | |||
// NewBareMetalV1 creates a ServiceClient that may be used with the v1 | |||
// bare metal package. | |||
func NewBareMetalV1(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error) { | |||
return initClientOpts(client, eo, "baremetal") | |||
sc, err := initClientOpts(client, eo, "baremetal") | |||
if !strings.HasSuffix(sc.Endpoint, "v1/") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible that we have suffix v1
without the /
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes you are right maybe we nee double check v1/ and v1 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it is best to check both ?
if !strings.HasSuffix(strings.TrimSuffix(sc.Endpoint, "/"), "v1")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at the initialization for the other clients, it seems unlikely the suffix has v1
without the /
, but better be safe than sorry.
535d100
to
a934f01
Compare
Fixes #2485
There is no documentation to link as it's only a configuration on keystone.