Skip to content
This repository has been archived by the owner on Mar 23, 2019. It is now read-only.

Commit

Permalink
During deploy, pass settings.k8s_namespace to the engine
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Houseknecht committed May 22, 2017
1 parent 7c168fd commit 8a6ba9d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 2 additions & 0 deletions container/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@ def hostcmd_deploy(base_path, project_name, engine_name, var_file=None,
}
if config.get('settings', {}).get('k8s_auth'):
params['k8s_auth'] = config['settings']['k8s_auth']
if config.get('settings', {}).get('k8s_namespace'):
params['k8s_namespace'] = config['settings']['k8s_namespace']
if kwargs:
params.update(kwargs)

Expand Down
10 changes: 6 additions & 4 deletions container/k8s/base_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,13 @@ class K8sBaseEngine(DockerEngine):
_deploy = None

def __init__(self, project_name, services, debug=False, selinux=True, **kwargs):
self.namesapce_name = kwargs.pop('namespace', None) or project_name
self.namespace_display_name = kwargs.pop('namespace_display_name', None)
self.namespace_description = kwargs.pop('namespace_description', None)
k8s_namespace = kwargs.pop('k8s_namespace', {})
self.namespace_name = k8s_namespace.get('name', None) or project_name
self.namespace_display_name = k8s_namespace.get('display_name')
self.namespace_description = k8s_namespace.get('description')
super(K8sBaseEngine, self).__init__(project_name, services, debug, selinux=selinux, **kwargs)
logger.debug("k8s namespace", namspace=self.namespace_name, display_name=self.namespace_display_name,
description=self.namespace_description)
logger.debug("Volume for k8s", volumes=self.volumes)

@property
Expand Down Expand Up @@ -135,4 +138,3 @@ def generate_orchestration_playbook(self, url=None, namespace=None, local_images

logger.debug(u'Created playbook to run project', playbook=playbook)
return playbook

0 comments on commit 8a6ba9d

Please sign in to comment.