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

chore: properly rename MustUnmarshalClusterWorkflowTemplate #13431

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
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 pkg/apis/workflow/v1alpha1/marshall.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func MustMarshallJSON(v interface{}) string {
return string(data)
}

func MustUnmarshalClusterWorkflow(text interface{}) *ClusterWorkflowTemplate {
func MustUnmarshalClusterWorkflowTemplate(text interface{}) *ClusterWorkflowTemplate {
x := &ClusterWorkflowTemplate{}
MustUnmarshal(text, &x)
return x
Expand Down
6 changes: 3 additions & 3 deletions pkg/apis/workflow/v1alpha1/marshall_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import (
"github.com/stretchr/testify/assert"
)

func TestMustUnmarshalClusterWorkflow(t *testing.T) {
func TestMustUnmarshalClusterWorkflowTemplate(t *testing.T) {
defer func() {
if r := recover(); r == nil {
t.Fatalf("The code did not panic but should have")
} else {
assert.Equal(t, "no text to unmarshal", r.(string))
}
}()
_ = MustUnmarshalClusterWorkflow([]byte(""))
t.Fatalf("MustUnmarshalClusterWorkflow should have panicked and this part should not have been reached.")
_ = MustUnmarshalClusterWorkflowTemplate([]byte(""))
t.Fatalf("MustUnmarshalClusterWorkflowTemplate should have panicked and this part should not have been reached.")
}
2 changes: 1 addition & 1 deletion workflow/controller/operator_template_scope_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ spec:

func TestTemplateClusterScope(t *testing.T) {
wf := wfv1.MustUnmarshalWorkflow(testTemplateClusterScopeWorkflowYaml)
cwftmpl := wfv1.MustUnmarshalClusterWorkflow(testTemplateClusterScopeWorkflowTemplateYaml1)
cwftmpl := wfv1.MustUnmarshalClusterWorkflowTemplate(testTemplateClusterScopeWorkflowTemplateYaml1)
wftmpl := wfv1.MustUnmarshalWorkflowTemplate(testTemplateScopeWorkflowTemplateYaml2)

cancel, controller := newController(wf, cwftmpl, wftmpl)
Expand Down
Loading