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(controller): Randomly expr expression fail to resolve #6410

Merged
merged 8 commits into from
Jul 27, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion workflow/common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ const (
// GlobalVarWorkflowDuration is the current duration of this workflow
GlobalVarWorkflowDuration = "workflow.duration"
// GlobalVarWorkflowParameters is a JSON string containing all workflow parameters
GlobalVarWorkflowParameters = "workflow.parameters"
GlobalVarWorkflowParameters = "workflow.parameters.json"
Copy link
Member Author

Choose a reason for hiding this comment

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

Randomly bellows.Expand failed to expend all global variable workflow.parameters.xxx if workflow.parameters expended first. We should have a different name for workflow.parameters json format.

Copy link
Contributor

Choose a reason for hiding this comment

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

we should raise a bug with bellows?

Copy link
Contributor

Choose a reason for hiding this comment

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

maybe not, I think it does not make sense - but can we make sure that this is not used - new in v3.1?

Copy link
Contributor

Choose a reason for hiding this comment

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

also - should work for fasttemplate

Copy link
Member Author

Choose a reason for hiding this comment

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

fasttemplate will just string replace. it will work. I can ask the community channel for this variable.

Copy link
Contributor

Choose a reason for hiding this comment

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

if it is in v3.0, then changing it would be breaking change

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should exclude this from {{= templates. Users should not need it.

Copy link
Member Author

Choose a reason for hiding this comment

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

we can prevent to have {{= in when element. So this is the way when will have only govaluate format.

// GlobalVarWorkflowCronScheduleTime is the scheduled timestamp of a Workflow started by a CronWorkflow
GlobalVarWorkflowCronScheduleTime = "workflow.scheduledTime"

Expand Down
2 changes: 1 addition & 1 deletion workflow/controller/operator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1975,7 +1975,7 @@ spec:
arguments:
parameters:
- name: json
value: "Workflow: {{workflow.parameters}}. Template: {{inputs.parameters}}"
value: "Workflow: {{workflow.parameters.json}}. Template: {{inputs.parameters}}"

- name: whalesay
inputs:
Expand Down