mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-09-23 06:24:44 -04:00
openstack: set region in cluster cloud client (#3375)
This commit is contained in:
parent
d65987cb15
commit
882d602524
5 changed files with 27 additions and 0 deletions
|
@ -172,6 +172,20 @@ func (c *imdsClient) userDomainName(ctx context.Context) (string, error) {
|
|||
return c.userDataCache.UserDomainName, nil
|
||||
}
|
||||
|
||||
func (c *imdsClient) regionName(ctx context.Context) (string, error) {
|
||||
if c.timeForUpdate(c.cacheTime) || c.userDataCache.RegionName == "" {
|
||||
if err := c.update(ctx); err != nil {
|
||||
return "", err
|
||||
}
|
||||
}
|
||||
|
||||
if c.userDataCache.RegionName == "" {
|
||||
return "", errors.New("unable to get user domain name")
|
||||
}
|
||||
|
||||
return c.userDataCache.RegionName, nil
|
||||
}
|
||||
|
||||
func (c *imdsClient) username(ctx context.Context) (string, error) {
|
||||
if c.timeForUpdate(c.cacheTime) || c.userDataCache.Username == "" {
|
||||
if err := c.update(ctx); err != nil {
|
||||
|
@ -295,6 +309,7 @@ type metadataTags struct {
|
|||
type userDataResponse struct {
|
||||
AuthURL string `json:"openstack-auth-url,omitempty"`
|
||||
UserDomainName string `json:"openstack-user-domain-name,omitempty"`
|
||||
RegionName string `json:"openstack-region-name,omitempty"`
|
||||
Username string `json:"openstack-username,omitempty"`
|
||||
Password string `json:"openstack-password,omitempty"`
|
||||
LoadBalancerEndpoint string `json:"openstack-load-balancer-endpoint,omitempty"`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue