Fix internal-* in identity service relation data
internal-host, internal-port, internal-protocol holds the values of admin endpoint. Change them to use internal endpoint. Change-Id: Ibb6985a9a67f4372d58ff199c09f82df0b7eb3b5
This commit is contained in:
parent
471e8b9f81
commit
897cd139a8
@ -40,6 +40,9 @@ from typing import (
|
||||
Dict,
|
||||
List,
|
||||
)
|
||||
from urllib.parse import (
|
||||
urlparse,
|
||||
)
|
||||
|
||||
import charms.keystone_k8s.v0.domain_config as sunbeam_dc_svc
|
||||
import charms.keystone_k8s.v0.identity_credentials as sunbeam_cc_svc
|
||||
@ -1244,6 +1247,12 @@ export OS_AUTH_VERSION=3
|
||||
region=region,
|
||||
may_exist=True,
|
||||
)
|
||||
parsed_internal_endpoint = urlparse(self.internal_endpoint)
|
||||
internal_host = parsed_internal_endpoint.hostname
|
||||
internal_protocol = parsed_internal_endpoint.scheme
|
||||
internal_port = parsed_internal_endpoint.port
|
||||
if not internal_port:
|
||||
internal_port = 80 if internal_protocol == "http" else 443
|
||||
self.id_svc.interface.set_identity_service_credentials(
|
||||
relation_name,
|
||||
relation_id,
|
||||
@ -1251,9 +1260,9 @@ export OS_AUTH_VERSION=3
|
||||
ingress_address,
|
||||
self.default_public_ingress_port,
|
||||
"http",
|
||||
ingress_address,
|
||||
self.default_public_ingress_port,
|
||||
"http",
|
||||
internal_host,
|
||||
internal_port,
|
||||
internal_protocol,
|
||||
ingress_address,
|
||||
self.default_public_ingress_port,
|
||||
"http",
|
||||
|
@ -213,8 +213,8 @@ class TestKeystoneOperatorCharm(test_utils.CharmTestCase):
|
||||
"auth-port": "5000",
|
||||
"auth-protocol": "http",
|
||||
"internal-auth-url": "http://internal-url/v3",
|
||||
"internal-host": "10.0.0.10",
|
||||
"internal-port": "5000",
|
||||
"internal-host": "internal-url",
|
||||
"internal-port": "80",
|
||||
"internal-protocol": "http",
|
||||
"public-auth-url": "http://public-url/v3",
|
||||
"service-domain-id": "sdomain_id",
|
||||
|
Loading…
x
Reference in New Issue
Block a user