From 4e3df13c29b85aa9c4378a43e9ed99355d6589bb Mon Sep 17 00:00:00 2001 From: okozachenko Date: Fri, 14 Aug 2020 08:42:18 +0300 Subject: [PATCH] Disable auto endpoint creation Change-Id: Idde1d48af7fd9bfba78d07137d9c1f147f8b890d --- openstack_operator/glance.py | 7 +++++-- openstack_operator/heat.py | 17 +++++++++++------ openstack_operator/magnum.py | 10 +++++++--- 3 files changed, 23 insertions(+), 11 deletions(-) diff --git a/openstack_operator/glance.py b/openstack_operator/glance.py index bb004c07..b0281428 100644 --- a/openstack_operator/glance.py +++ b/openstack_operator/glance.py @@ -50,8 +50,11 @@ def create_or_resume(name, spec, **_): name=name, spec=spec) url = spec["ingress"]["host"] - identity.ensure_service(name="glance", service_type="image", - url=url, desc="Glance Image Service") + if "endpoint" not in spec: + spec["endpoint"] = True + if spec["endpoint"]: + identity.ensure_service(name="glance", service_type="image", + url=url, desc="Glance Image Service") def update(name, spec, **_): diff --git a/openstack_operator/heat.py b/openstack_operator/heat.py index 22c2e220..e68c37b2 100644 --- a/openstack_operator/heat.py +++ b/openstack_operator/heat.py @@ -74,12 +74,17 @@ def create_or_resume(name, spec, **_): identity.ensure_application_credential(name="heat") # Create service and endpoints - identity.ensure_service(name="heat-api", service_type="orchestration", - url=api_url, path="/v1/$(project_id)s", - desc="Heat Orchestration Service") - identity.ensure_service(name="heat-api-cfn", service_type="cloudformation", - url=cfn_url, path="/v1", - desc="Heat CloudFormation Service") + if "endpoint" not in spec: + spec["endpoint"] = True + if spec["endpoint"]: + identity.ensure_service(name="heat-api", + service_type="orchestration", + url=api_url, path="/v1/$(project_id)s", + desc="Heat Orchestration Service") + identity.ensure_service(name="heat-api-cfn", + service_type="cloudformation", + url=cfn_url, path="/v1", + desc="Heat CloudFormation Service") def update(name, spec, **_): diff --git a/openstack_operator/magnum.py b/openstack_operator/magnum.py index 5c82ef77..4e59f304 100644 --- a/openstack_operator/magnum.py +++ b/openstack_operator/magnum.py @@ -61,9 +61,13 @@ def create_or_resume(name, spec, **_): url = spec["ingress"]["host"] # Create service and endpoints - identity.ensure_service(name="magnum-api", path="/v1", - service_type="container-infra", url=url, - desc="Container Infrastructure Management Service") + if "endpoint" not in spec: + spec["endpoint"] = True + if spec["endpoint"]: + identity.ensure_service(name="magnum-api", path="/v1", + service_type="container-infra", url=url, + desc="Container Infrastructure \ + Management Service") def update(name, spec, **_):