Skip to content
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(server): Fix validation of overridden ref template parameters. #3286

Merged

Conversation

vladlosev
Copy link
Contributor

@vladlosev vladlosev commented Jun 24, 2020

We encountered this problem when submitting workflows via the Argo server API. The included test illustrates the issue. It breaks with

--- FAIL: TestWorkflowWithWFTRefWithOverrideParam (0.00s)
    validate_test.go:2570:
        	Error Trace:	validate_test.go:2570
        	Error:      	Received unexpected error:
        	            	spec.arguments.some-param.value is required

without the code fix.

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this is a chore.
  • The title of the PR is (a) conventional, (b) states what changed, and (c) suffixes the related issues number. E.g. "fix(controller): Updates such and such. Fixes #1234".
  • I've signed the CLA.
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My builds are green. Try syncing with master if they are not.
  • My organization is added to USERS.md.

@@ -149,7 +149,7 @@ func ValidateWorkflow(wftmplGetter templateresolution.WorkflowTemplateNamespaced
wfArgs := wf.Spec.Arguments

if wf.Spec.WorkflowTemplateRef != nil {
wfArgs.Parameters = util.MergeParameters(wfSpecHolder.GetWorkflowSpec().Arguments.Parameters, wfArgs.Parameters)
wfArgs.Parameters = util.MergeParameters(wfArgs.Parameters, wfSpecHolder.GetWorkflowSpec().Arguments.Parameters)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch.

@sarabala1979 sarabala1979 merged commit d44d264 into argoproj:master Jun 24, 2020
@vladlosev vladlosev deleted the fix-workflow-template-param-validation branch June 24, 2020 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants