From 6079a5899edba042c2ab2750c2b4106acebb46c5 Mon Sep 17 00:00:00 2001 From: Emilien Macchi Date: Thu, 14 Jun 2018 14:37:55 -0700 Subject: [PATCH] kolla_builder: use any templates except puppet We have more and more services that use containers now, and not only OpenShift, k8s. We now have Skydive and probably more services in extraconfig/services that will come in the future. This patch will use all but puppet templates to determines where are the containers that we want to prepare with kolla. Change-Id: I16a9e8533ba8cf1553ccac8c43f7556a71bd5b15 --- tripleo_common/image/kolla_builder.py | 8 ++------ tripleo_common/tests/image/test_kolla_builder.py | 11 +++++++++-- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/tripleo_common/image/kolla_builder.py b/tripleo_common/image/kolla_builder.py index e7a524ced..98e2aa218 100644 --- a/tripleo_common/image/kolla_builder.py +++ b/tripleo_common/image/kolla_builder.py @@ -90,13 +90,9 @@ def build_service_filter(environment, roles_data): # enabled services return enabled_services - # Use the template path to determine if it represents a - # containerized service - containerized_services_path = ['/docker/services/', - '/services/kubernetes', - '/services/openshift'] for service, env_path in environment.get('resource_registry', {}).items(): - if any(p in env_path for p in containerized_services_path): + if not any(p in env_path for p in ['/puppet/services', + 'OS::Heat::None']): containerized_services.add(service) return containerized_services.intersection(enabled_services) diff --git a/tripleo_common/tests/image/test_kolla_builder.py b/tripleo_common/tests/image/test_kolla_builder.py index 463e26212..dfaf8bcaf 100644 --- a/tripleo_common/tests/image/test_kolla_builder.py +++ b/tripleo_common/tests/image/test_kolla_builder.py @@ -685,6 +685,7 @@ class TestPrepare(base.TestCase): 'OS::TripleO::Services::NovaCompute', 'OS::TripleO::Services::OpenShift::Master', 'OS::TripleO::Services::Kubernetes::Worker', + 'OS::TripleO::Services::SkydiveAgent', ]), kb.build_service_filter({ 'resource_registry': { @@ -697,7 +698,11 @@ class TestPrepare(base.TestCase): 'OS::TripleO::Services::OpenShift::Master': 'extraconfig/services/openshift-master.yaml', 'OS::TripleO::Services::Kubernetes::Worker': - 'extraconfig/services/kubernetes-worker.yaml' + 'extraconfig/services/kubernetes-worker.yaml', + 'OS::TripleO::Services::SkydiveAgent': + 'extraconfig/services/skydive-agent.yaml', + 'OS::TripleO::Services::Noop': + 'OS::Heat::None' } }, [ { @@ -706,7 +711,9 @@ class TestPrepare(base.TestCase): 'ServicesDefault': [ 'OS::TripleO::Services::NeutronApi', 'OS::TripleO::Services::NovaApi', - 'OS::TripleO::Services::OpenShift::Master' + 'OS::TripleO::Services::OpenShift::Master', + 'OS::TripleO::Services::SkydiveAgent', + 'OS::TripleO::Services::Noop' ] }, { 'name': 'Compute',