Browse Source

Merge "[fix] Append v3/v1 to auth_url/magnum_url if discovery fails"

changes/93/744493/1
Zuul 4 days ago
committed by Gerrit Code Review
parent
commit
e2135ac11f
3 changed files with 29 additions and 3 deletions
  1. +10
    -1
      magnum/drivers/heat/k8s_template_def.py
  2. +10
    -1
      magnum/drivers/heat/swarm_mode_template_def.py
  3. +9
    -1
      magnum/drivers/heat/template_def.py

+ 10
- 1
magnum/drivers/heat/k8s_template_def.py View File

@@ -219,7 +219,16 @@ class K8sTemplateDefinition(template_def.BaseTemplateDefinition):

extra_params['discovery_url'] = self.get_discovery_url(cluster)
osc = self.get_osc(context)
extra_params['magnum_url'] = osc.magnum_url()
# NOTE: Sometimes, version discovery fails when Magnum cannot talk to
# Keystone via specified magnum_client.endpoint_type intended for
# cluster instances either because it is not unreachable from the
# controller or CA certs are missing for TLS enabled interface and the
# returned auth_url may not be suffixed with /v1 in which case append
# the url with the suffix so that instances can still talk to Magnum.
magnum_url = osc.magnum_url()
extra_params['magnum_url'] = magnum_url + ('' if
magnum_url.endswith('/v1')
else '/v1')

if cluster_template.tls_disabled:
extra_params['loadbalancing_protocol'] = 'HTTP'


+ 10
- 1
magnum/drivers/heat/swarm_mode_template_def.py View File

@@ -117,7 +117,16 @@ class SwarmModeTemplateDefinition(template_def.BaseTemplateDefinition):
# it should be replaced with an actual trust token with only
# access to do what the template needs it to do.
osc = self.get_osc(context)
extra_params['magnum_url'] = osc.magnum_url()
# NOTE: Sometimes, version discovery fails when Magnum cannot talk to
# Keystone via specified magnum_client.endpoint_type intended for
# cluster instances either because it is not unreachable from the
# controller or CA certs are missing for TLS enabled interface and the
# returned auth_url may not be suffixed with /v1 in which case append
# the url with the suffix so that instances can still talk to Magnum.
magnum_url = osc.magnum_url()
extra_params['magnum_url'] = magnum_url + ('' if
magnum_url.endswith('/v1')
else '/v1')

label_list = ['rexray_preempt', 'availability_zone']



+ 9
- 1
magnum/drivers/heat/template_def.py View File

@@ -399,7 +399,15 @@ class BaseTemplateDefinition(TemplateDefinition):
}
if CONF.trust.trustee_keystone_region_name:
kwargs['region_name'] = CONF.trust.trustee_keystone_region_name
extra_params['auth_url'] = osc.url_for(**kwargs).rstrip('/')
# NOTE: Sometimes, version discovery fails when Magnum cannot talk to
# Keystone via specified trustee_keystone_interface intended for
# cluster instances either because it is not unreachable from the
# controller or CA certs are missing for TLS enabled interface and the
# returned auth_url may not be suffixed with /v3 in which case append
# the url with the suffix so that instances can still talk to Keystone.
auth_url = osc.url_for(**kwargs).rstrip('/')
extra_params['auth_url'] = auth_url + ('' if auth_url.endswith('/v3')
else '/v3')

return super(BaseTemplateDefinition,
self).get_params(context, cluster_template, cluster,


Loading…
Cancel
Save