-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: consistent variable substitution for configMapKeyRef
. Fixes #13890
#13921
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…proj#13890 Support for subsituting variables in `configMapKeyRef` was added in argoproj#7542 by manually parsing templates out of the string instead of using the standard `template.Replace()` functionality. Since the templates have the same syntax as simple template tags (e.g. `{{workflow.parameters.cm-name}}`), users reasonably expect it to work the same, but it doesn't, which leads to confusion. This replaces the manual parsing code with the standard `template.Replace()` function that everything else uses. Signed-off-by: Mason Malone <[email protected]>
configMapKeyRef
. Fixes #13890
4 tasks
MasonM
commented
Nov 19, 2024
test/e2e/hooks_test.go
Outdated
@@ -805,7 +805,7 @@ spec: | |||
args: ["sleep", "5"] | |||
`).When(). | |||
SubmitWorkflow(). | |||
WaitForWorkflow(fixtures.ToBeCompleted). | |||
WaitForWorkflow(fixtures.ToBeCompleted, killDuration). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Timeout increased because this test is flaky:
hooks_test.go:808: timeout after 1m30s waiting for condition
https://github.com/argoproj/argo-workflows/actions/runs/11922046836/job/33227659623?pr=13921
Signed-off-by: Mason Malone <[email protected]>
tczhao
approved these changes
Nov 24, 2024
isubasinghe
pushed a commit
to pipekit/argo-workflows
that referenced
this pull request
Jan 30, 2025
…goproj#13890 (argoproj#13921) Signed-off-by: Mason Malone <[email protected]>
isubasinghe
pushed a commit
to pipekit/argo-workflows
that referenced
this pull request
Jan 31, 2025
…goproj#13890 (argoproj#13921) Signed-off-by: Mason Malone <[email protected]>
Joibel
pushed a commit
that referenced
this pull request
Feb 7, 2025
…3890 (#13921) Signed-off-by: Mason Malone <[email protected]> (cherry picked from commit f2159dc)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #13890
Motivation
Support for substituting variables in
configMapKeyRef
was added in #7542 by manually parsing templates out of the string, instead of using the standardtemplate.Replace()
function. Since the manual parsing logic uses the same syntax as simple template tags (e.g.{{workflow.parameters.cm-name}}
), users reasonably expect it to work the same, but it doesn't, which leads to confusion. Additionally, supporting templates like{{workflow.parameters.cm-name}}-cm
is important, because that's a common pattern.Modifications
This replaces the manual parsing code with the standard
template.Replace()
function that everything else uses.Verification
Verified by running the example workflow from #13890 locally:
