Skip to content

Commit

Permalink
Merge pull request #68 from sclorg/fix_test_openshift_generation
Browse files Browse the repository at this point in the history
test_openshift.yaml has for like TAG: TAG_VALUE
  • Loading branch information
phracek authored Oct 3, 2022
2 parents dadc70b + 57aac78 commit d0348ec
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion container_workflow_tool/distgit.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def _update_variable_in_string(self, fdata: str = "", tag: str = "", tag_str: st
It replaces OS: OS_VERSION -> OS: <os_name>"
"""
self.logger.debug(f"Replaces variable of tag {tag} from {tag_str} to {variable}")
ret = re.sub(rf'{tag}: "{tag_str}"', f"{tag}: \"{variable}\"", fdata)
ret = re.sub(rf"{tag}: {tag_str}", f"{tag}: \"{variable}\"", fdata)
return ret

def _update_test_openshift_yaml(self, test_openshift_yaml, version: str = "", short_name: str = ""):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def get_dir(system_path=None, virtual_path=None):

setup(
name='container-workflow-tool',
version="1.5.0",
version="1.5.1",
description='A python3 tool to make rebuilding images easier by automating several steps of the process.',
long_description=long_description,
long_description_content_type='text/markdown',
Expand Down
6 changes: 3 additions & 3 deletions tests/data/test-openshift.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
- openshift

environment:
VERSION: "VERSION_NUMBER"
OS: "OS_NUMBER"
SHORT_NAME: "CONTAINER_NAME"
VERSION: VERSION_NUMBER
OS: OS_NUMBER
SHORT_NAME: CONTAINER_NAME
IMAGE_FULL_NAME: "{{ image_full_name }}"
IMAGE_REGISTRY_URL: "{{ image_registry_url }}"
IMAGE_NAMESPACE: "{{ image_namespace }}"
Expand Down
3 changes: 3 additions & 0 deletions tests/test_distgit.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,15 @@ def test_tag_dockerfile(self):
[
("VERSION", "VERSION_NUMBER", "base", True),
("VERSION", "VERSION_NUMBER", "1.14", True),
("VERSION", "\"VERSION_NUMBER\"", "1.14", False),
("OS", "OS_NUMBER", "rhel8", True),
("VER", "VERSION_NUMBER", "base", False),
("OS", "OS_NUMBER", "rhel9", True),
("OS", "\"OS_NUMBER\"", "rhel9", False),
("OS", "VERSION_NUMBER", "base", False),
("VERSION", "VERSIONS_NUMBER", "1.14", False),
("SHORT_NAME", "CONTAINER_NAME", "nodejs", True),
("SHORT_NAME", "\"CONTAINER_NAME\"", "nodejs", False),
("SHORT_NAME", "CONT_NAME", "nodejs", False),
("SHORTNAME", "CONTAINER_NAME", "nodejs", False),
]
Expand Down

0 comments on commit d0348ec

Please sign in to comment.