Skip to content

Commit

Permalink
fix(helm): allow numeric quoted strings as image tags (#8120)
Browse files Browse the repository at this point in the history
  • Loading branch information
rexledesma committed May 31, 2022
1 parent dbae025 commit 72c4e50
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ If release name contains chart name it will be used as a full name.
{{- $ := index . 0 }}

{{- with index . 1 }}
{{- $tag := .tag | default $.Chart.Version | toYaml }}
# Filter the tag to parse strings, string integers, and string floats.
{{- $tag := .tag | default $.Chart.Version | toYaml | trimAll "\"" }}
{{- printf "%s:%s" .repository $tag }}
{{- end }}
{{- end }}
Expand Down
2 changes: 1 addition & 1 deletion helm/dagster/schema/schema_tests/test_user_deployments.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ def test_user_deployment_default_image_tag_is_chart_version(
assert image_tag == chart_version


@pytest.mark.parametrize("tag", [5176135, "abc1234"])
@pytest.mark.parametrize("tag", [5176135, "abc1234", "20220531.1", "1234"])
def test_user_deployment_tag_can_be_numeric(template: HelmTemplate, tag: Union[str, int]):
deployment = create_simple_user_deployment("foo")
deployment.image.tag = tag
Expand Down
3 changes: 2 additions & 1 deletion helm/dagster/templates/helpers/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ If release name contains chart name it will be used as a full name.
{{- $ := index . 0 }}

{{- with index . 1 }}
{{- $tag := .tag | default $.Chart.Version | toYaml }}
# Filter the tag to parse strings, string integers, and string floats.
{{- $tag := .tag | default $.Chart.Version | toYaml | trimAll "\"" }}
{{- printf "%s:%s" .repository $tag }}
{{- end }}
{{- end }}
Expand Down

0 comments on commit 72c4e50

Please sign in to comment.