Skip to content

Commit d886a78

Browse files
authored
Merge pull request #284 from fmount/scope
Get gophercloud system wide client
2 parents 0e22825 + a55d220 commit d886a78

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

modules/openstack/openstack.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,25 @@ type AuthOpts struct {
4040
TenantName string
4141
DomainName string
4242
Region string
43+
Scope *gophercloud.AuthScope
4344
}
4445

4546
// NewOpenStack creates a new new instance of the openstack struct from a config struct
4647
func NewOpenStack(
4748
log logr.Logger,
4849
cfg AuthOpts,
4950
) (*OpenStack, error) {
51+
5052
opts := gophercloud.AuthOptions{
5153
IdentityEndpoint: cfg.AuthURL,
5254
Username: cfg.Username,
5355
Password: cfg.Password,
5456
TenantName: cfg.TenantName,
5557
DomainName: cfg.DomainName,
5658
}
59+
if cfg.Scope != nil {
60+
opts.Scope = cfg.Scope
61+
}
5762

5863
provider, err := openstack.AuthenticatedClient(opts)
5964
if err != nil {

0 commit comments

Comments
 (0)