Merge "Preserve quotes in building helm charts"

This commit is contained in:
Zuul 2020-10-13 18:06:37 +00:00 committed by Gerrit Code Review
commit b153028880
2 changed files with 3 additions and 2 deletions

View File

@ -315,7 +315,7 @@ def merge_yaml(yaml_merged, yaml_new):
yaml_out = collections.OrderedDict()
for yaml_file in yaml_files:
print 'Merging yaml from file: %s' % yaml_file
for document in yaml.load_all(open(yaml_file), Loader=yaml.RoundTripLoader):
for document in yaml.load_all(open(yaml_file), Loader=yaml.RoundTripLoader, preserve_quotes=True):
document_name = (document['schema'], document['metadata']['schema'], document['metadata']['name'])
if document_name in yaml_out:
merge_yaml(yaml_out[document_name], document)

View File

@ -159,7 +159,8 @@ def main(argv):
new_image_dict[name] = image
# Load chart into dictionary(s) and then modify any image locations/tags if required
for document in yaml.load_all(open(yaml_file), Loader=yaml.RoundTripLoader):
for document in yaml.load_all(
open(yaml_file), Loader=yaml.RoundTripLoader, preserve_quotes=True):
document_name = (document['schema'],
document['metadata']['schema'],
document['metadata']['name'])