diff --git a/provider/openstack/credentials.go b/provider/openstack/credentials.go index cc1e15e4f565..20935ae1a0ad 100644 --- a/provider/openstack/credentials.go +++ b/provider/openstack/credentials.go @@ -26,6 +26,7 @@ const ( CredAttrPassword = "password" CredAttrDomainName = "domain-name" CredAttrProjectDomainName = "project-domain-name" + CredAttrProjectDomainID = "project-domain-id" CredAttrUserDomainName = "user-domain-name" CredAttrAccessKey = "access-key" CredAttrSecretKey = "secret-key" @@ -70,6 +71,11 @@ func (OpenstackCredentials) CredentialSchemas() map[cloud.AuthType]cloud.Credent Description: "The OpenStack project domain name.", Optional: true, }, + }, { + CredAttrProjectDomainID, cloud.CredentialAttr{ + Description: "The OpenStack project domain ID.", + Optional: true, + }, }, { CredAttrUserDomainName, cloud.CredentialAttr{ Description: "The OpenStack user domain name.", @@ -185,6 +191,7 @@ func (c OpenstackCredentials) detectCredential() (*cloud.Credential, string, str CredAttrTenantID: creds.TenantID, CredAttrUserDomainName: creds.UserDomain, CredAttrProjectDomainName: creds.ProjectDomain, + CredAttrProjectDomainID: creds.ProjectDomainID, CredAttrDomainName: creds.Domain, CredAttrVersion: version, }, diff --git a/provider/openstack/provider.go b/provider/openstack/provider.go index 0eaf45676c87..3df7e2bd3b35 100644 --- a/provider/openstack/provider.go +++ b/provider/openstack/provider.go @@ -841,6 +841,7 @@ func newCredentials(spec environscloudspec.CloudSpec) (identity.Credentials, ide cred.User = credAttrs[CredAttrUserName] cred.Secrets = credAttrs[CredAttrPassword] cred.ProjectDomain = credAttrs[CredAttrProjectDomainName] + cred.ProjectDomainID = credAttrs[CredAttrProjectDomainID] cred.UserDomain = credAttrs[CredAttrUserDomainName] cred.Domain = credAttrs[CredAttrDomainName] if credAttrs[CredAttrVersion] != "" {