Skip to content

Commit

Permalink
fix: improve error message when the controller is set `templateRefere…
Browse files Browse the repository at this point in the history
…ncing: Secure` (#8277)

Signed-off-by: mikutas <23391543+mikutas@users.noreply.github.com>
  • Loading branch information
mikutas authored Mar 30, 2022
1 parent 5598b8c commit b198b33
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion workflow/controller/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -3535,7 +3535,7 @@ func (woc *wfOperationCtx) setStoredWfSpec() error {
return err
}
if mergedWf.Spec.String() != woc.wf.Status.StoredWorkflowSpec.String() {
return fmt.Errorf("workflowTemplateRef reference may not change during execution when the controller is in reference mode")
return fmt.Errorf("WorkflowSpec may not change during execution when the controller is set `templateReferencing: Secure`")
}
}
return nil
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 @@ -4733,7 +4733,7 @@ func TestValidReferenceMode(t *testing.T) {
woc = newWorkflowOperationCtx(woc.wf, controller)
woc.operate(ctx)
assert.Equal(t, wfv1.WorkflowError, woc.wf.Status.Phase)
assert.Equal(t, "workflowTemplateRef reference may not change during execution when the controller is in reference mode", woc.wf.Status.Message)
assert.Equal(t, "WorkflowSpec may not change during execution when the controller is set `templateReferencing: Secure`", woc.wf.Status.Message)

controller.Config.WorkflowRestrictions.TemplateReferencing = config.TemplateReferencingStrict
woc = newWorkflowOperationCtx(wf, controller)
Expand Down

0 comments on commit b198b33

Please sign in to comment.