From efdca0d3d32b09ac39c6d4f092f85f56b214d348 Mon Sep 17 00:00:00 2001 From: Zhenguo Niu Date: Wed, 20 Nov 2019 11:04:37 +0800 Subject: [PATCH] Add Bss Domain info --- auth_aksk_options.go | 4 ++++ openstack/client.go | 11 ++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/auth_aksk_options.go b/auth_aksk_options.go index b74190dba..108d635a2 100644 --- a/auth_aksk_options.go +++ b/auth_aksk_options.go @@ -23,6 +23,10 @@ type AKSKAuthOptions struct { Domain string DomainID string + // cloud service domain for BSS + BssDomain string + BssDomainID string + AccessKey string //Access Key SecretKey string //Secret key diff --git a/openstack/client.go b/openstack/client.go index cf2ac5553..9d0494832 100644 --- a/openstack/client.go +++ b/openstack/client.go @@ -339,8 +339,17 @@ func v3AKSKAuth(client *golangsdk.ProviderClient, endpoint string, options golan } } + if options.BssDomainID == "" && options.BssDomain != "" { + id, err := getDomainID(options.BssDomain, v3Client) + if err != nil { + options.BssDomainID = "" + } else { + options.BssDomainID = id + } + } + client.ProjectID = options.ProjectId - client.DomainID = options.DomainID + client.DomainID = options.BssDomainID v3Client.ProjectID = options.ProjectId var entries = make([]tokens3.CatalogEntry, 0, 1)