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: Cannot create WorkflowTemplate with un-supplied inputs #2869

Merged
merged 67 commits into from Apr 28, 2020

Conversation

sarabala1979
Copy link
Member

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". Cannot create WorkflowTemplate with unsupplied inputs #2857
  • 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.

@alexec alexec self-assigned this Apr 28, 2020
Copy link
Contributor

@alexec alexec left a comment

Choose a reason for hiding this comment

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

Looks goods. Need tests.

@@ -172,7 +175,13 @@ func ValidateWorkflow(wftmplGetter templateresolution.WorkflowTemplateNamespaced
}

if !opts.IgnoreEntrypoint {
_, err = ctx.validateTemplateHolder(&wfv1.WorkflowStep{Template: wf.Spec.Entrypoint}, tmplCtx, &wf.Spec.Arguments, map[string]interface{}{})
var args wfv1.ArgumentsProvider
args = &wf.Spec.Arguments
Copy link
Member

Choose a reason for hiding this comment

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

Why not

Suggested change
args = &wf.Spec.Arguments
args := &wf.Spec.Arguments

Instead of var args wfv1.ArgumentsProvider?

Copy link
Member Author

Choose a reason for hiding this comment

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

FakeArgument is a separate struct. ArgumentsProvider is a common interface that used to pass either wfv1. Argument or FakeArgument.

Copy link
Member

Choose a reason for hiding this comment

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

Ah, of course!

workflow/validate/validate.go Outdated Show resolved Hide resolved
@sonarcloud
Copy link

sonarcloud bot commented Apr 28, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

87.5% 87.5% Coverage
0.0% 0.0% Duplication

@sarabala1979 sarabala1979 merged commit e378ca4 into argoproj:master Apr 28, 2020
@alexec
Copy link
Contributor

alexec commented May 27, 2020

@sarabala1979 I think this bug fix need back-porting to v2.8?

@sarabala1979
Copy link
Member Author

yes we need to do it

@mildewey
Copy link

The combination of this issue and the fact that 2.7.x doesn't support "{{workflow.status}}" for onExit templates of workflow-templates means we're waiting anxiously for this fix to go in. Is there an ETA on 2.8.1?

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.

None yet

4 participants