Skip to content

Commit

Permalink
Rename imageNameSuffix to imageVersion in docker compose generator (#89)
Browse files Browse the repository at this point in the history
  • Loading branch information
svrnm authored Jan 8, 2025
1 parent 2c6f289 commit 154ed20
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion scripts/generators/docker-compose/createComposeFile.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

defaultValues = {
"imageNamePrefix": "ghcr.io/cisco-open/",
"imageNameSuffix": "latest",
"imageVersion": "latest",
"defaultPorts": {
"services": 80, # this is different from the "default default" on purpose.
"databases": 5432,
Expand Down
2 changes: 1 addition & 1 deletion scripts/generators/docker-compose/docker-compose.j2
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ services:
## {{ scope }}
{%- for name, details in scopeDetails.items() %}
{{ name }}:
image: {{ global.imageNamePrefix }}app-simulator-{{ scope }}-{{ details.type }}:{{global.imageNameSuffix }}
image: {{ global.imageNamePrefix }}app-simulator-{{ scope }}-{{ details.type }}:{{global.imageVersion }}
{%- if details.port is defined %}
ports:
- "{{ details.port }}:{{ global.defaultPorts[scope] }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def test_render_compose_file_with_simple_config_and_no_defaults(load_template):
result = render_compose_file(load_template, {
"global": {
"imageNamePrefix": "test/",
"imageNameSuffix": "test"
"imageVersion": "test"
},
"services": {
"test": {
Expand Down Expand Up @@ -94,7 +94,7 @@ def test_render_compose_file_with_simple_config_and_defaults(load_template):
}
}, {
"imageNamePrefix": "test/",
"imageNameSuffix": "test"
"imageVersion": "test"
})
expected = """
services:
Expand Down Expand Up @@ -133,7 +133,7 @@ def test_render_compose_file_with_port_config(load_template):
result = render_compose_file(load_template, {
"global": {
"imageNamePrefix": "test/",
"imageNameSuffix": "test",
"imageVersion": "test",
"defaultPorts": {
"services": 1024,
"databases": 5432,
Expand Down

0 comments on commit 154ed20

Please sign in to comment.