Skip to content
Permalink
Browse files

fix(composer): fix yaml generation

  • Loading branch information...
hanxiao committed Aug 6, 2019
1 parent e5fefce commit 2191b27b4f1f0cf027cd00058c85bc795eeb682c
Showing with 7 additions and 3 deletions.
  1. +7 −3 gnes/composer/base.py
@@ -188,8 +188,11 @@ def build_dockerswarm(all_layers: List['YamlComposer.Layer'], docker_img: str =
args = ['--%s %s' % (a, str(v) if ' ' not in str(v) else ('"%s"' % str(v))) for a, v in c.items() if
a in YamlComposer.comp2args[c['name']] and a != 'yaml_path' and v]
if 'yaml_path' in c and c['yaml_path'] is not None:
args.append('--yaml_path /%s_yaml' % c_name)
config_dict['%s_yaml' % c_name] = {'file': c['yaml_path']}
if c['yaml_path'].endswith('.yml') or c['yaml_path'].endswith('.yaml'):
args.append('--yaml_path /%s_yaml' % c_name)
config_dict['%s_yaml' % c_name] = {'file': c['yaml_path']}
else:
args.append('--yaml_path %s' % c['yaml_path'])

if l_idx + 1 < len(all_layers):
next_layer = all_layers[l_idx + 1]
@@ -237,7 +240,8 @@ def build_dockerswarm(all_layers: List['YamlComposer.Layer'], docker_img: str =
}
})

if 'yaml_path' in c and c['yaml_path'] is not None:
if 'yaml_path' in c and c['yaml_path'] is not None \
and (c['yaml_path'].endswith('.yml') or c['yaml_path'].endswith('.yaml')):
swarm_lines['services'][c_name]['configs'] = ['%s_yaml' % c_name]

if c['name'] == 'gRPCFrontend':

0 comments on commit 2191b27

Please sign in to comment.
You can’t perform that action at this time.