Skip to content

Commit

Permalink
Merge pull request #115 from consideRatio/pr/preserve-quote-and-reada…
Browse files Browse the repository at this point in the history
…bility-refactor

fix: preserve quote formatting for image tags also
  • Loading branch information
minrk authored Jan 20, 2021
2 parents 541ac0e + 7e3a2d6 commit 387ee96
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions chartpress.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

import docker
from ruamel.yaml import YAML
from ruamel.yaml.scalarstring import SingleQuotedScalarString

__version__ = '1.0.4.dev'

Expand All @@ -28,9 +27,10 @@
# name of possible repository keys used in image value
IMAGE_REPOSITORY_KEYS = {'name', 'repository'}

# use safe roundtrip yaml loader
# use safe roundtrip yaml loader capable or preserving usage of no/single/double
# quotes for a string for example
yaml = YAML(typ='rt')
yaml.preserve_quotes = True ## avoid mangling of quotes
yaml.preserve_quotes = True
yaml.indent(mapping=2, offset=2, sequence=4)


Expand Down Expand Up @@ -473,7 +473,7 @@ def build_images(prefix, images, tag=None, push=False, force_push=False, force_b
for values_path in values_path_list:
values_file_modifications[values_path] = {
'repository': image_name,
'tag': SingleQuotedScalarString(image_tag),
'tag': image_tag,
}

if skip_build:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def run(self):
keywords=['helm', 'kubernetes'],
python_requires=">=3.6",
install_requires=[
'ruamel.yaml>=0.15',
'ruamel.yaml>=0.15.44',
'docker>=3.2.0',
],
classifiers=[
Expand Down

0 comments on commit 387ee96

Please sign in to comment.