Skip to content

Commit

Permalink
Fix authorization with raw credentials
Browse files Browse the repository at this point in the history
  • Loading branch information
outcatcher committed Mar 27, 2020
1 parent 863a687 commit 1dc73b0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export PATH:=/usr/local/go/bin:$(PATH)
exec_path := /usr/local/bin/
exec_name := docker-machine-driver-otc

VERSION := 0.2.1b1
VERSION := 0.2.1b2


default: test build
Expand Down
1 change: 0 additions & 1 deletion driver/opentelekomcloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,6 @@ func (d *Driver) Authenticate() error {
ProjectID: d.ProjectID,
ProjectDomainName: d.DomainName,
ProjectDomainID: d.DomainID,
DefaultDomain: d.DomainName,
Token: d.Token,
},
}
Expand Down
12 changes: 12 additions & 0 deletions driver/services/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,18 @@ func (c *Client) Authenticate(opts *clientconfig.ClientOpts) error {
}
c.endpointType = getEndpointType(cloud.EndpointType)
c.region = cloud.RegionName
} else {
if ao.DomainID == "" {
ao.DomainID = opts.AuthInfo.ProjectDomainID
}
if ao.DomainName == "" {
ao.DomainName = opts.AuthInfo.ProjectDomainName
}
if opts.RegionName == "" {
opts.RegionName = defaultRegion
}
c.endpointType = getEndpointType(opts.EndpointType)
c.region = opts.RegionName
}

userAgent := fmt.Sprintf("docker-machine/v%d", version.APIVersion)
Expand Down

0 comments on commit 1dc73b0

Please sign in to comment.