Merge "Whitelist k8s and OpenShift services as containerized"
This commit is contained in:
@@ -90,10 +90,13 @@ 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():
|
||||
# Use the template path to determine if it represents a
|
||||
# containerized service
|
||||
if '/docker/services/' in env_path:
|
||||
if any(p in env_path for p in containerized_services_path):
|
||||
containerized_services.add(service)
|
||||
|
||||
return containerized_services.intersection(enabled_services)
|
||||
|
@@ -682,7 +682,9 @@ class TestPrepare(base.TestCase):
|
||||
self.assertEqual(
|
||||
set([
|
||||
'OS::TripleO::Services::NovaApi',
|
||||
'OS::TripleO::Services::NovaCompute'
|
||||
'OS::TripleO::Services::NovaCompute',
|
||||
'OS::TripleO::Services::OpenShift::Master',
|
||||
'OS::TripleO::Services::Kubernetes::Worker',
|
||||
]),
|
||||
kb.build_service_filter({
|
||||
'resource_registry': {
|
||||
@@ -692,6 +694,10 @@ class TestPrepare(base.TestCase):
|
||||
'/tht/docker/services/foo.yaml',
|
||||
'OS::TripleO::Services::NovaCompute':
|
||||
'/tht/docker/services/foo.yaml',
|
||||
'OS::TripleO::Services::OpenShift::Master':
|
||||
'extraconfig/services/openshift-master.yaml',
|
||||
'OS::TripleO::Services::Kubernetes::Worker':
|
||||
'extraconfig/services/kubernetes-worker.yaml'
|
||||
}
|
||||
}, [
|
||||
{
|
||||
@@ -699,13 +705,15 @@ class TestPrepare(base.TestCase):
|
||||
'CountDefault': 1,
|
||||
'ServicesDefault': [
|
||||
'OS::TripleO::Services::NeutronApi',
|
||||
'OS::TripleO::Services::NovaApi'
|
||||
'OS::TripleO::Services::NovaApi',
|
||||
'OS::TripleO::Services::OpenShift::Master'
|
||||
]
|
||||
}, {
|
||||
'name': 'Compute',
|
||||
'CountDefault': 1,
|
||||
'ServicesDefault': [
|
||||
'OS::TripleO::Services::NovaCompute'
|
||||
'OS::TripleO::Services::NovaCompute',
|
||||
'OS::TripleO::Services::Kubernetes::Worker'
|
||||
]
|
||||
}, {
|
||||
'name': 'BlockStorage',
|
||||
|
Reference in New Issue
Block a user