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

Added CEL to list of valid ExpressionLangs #188

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
6 changes: 5 additions & 1 deletion model/workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ func (i ExpressionLangType) KindValues() []string {
return []string{
string(JqExpressionLang),
string(JsonPathExpressionLang),
string(CELExpressionLang),
}
}

Expand All @@ -88,6 +89,9 @@ const (

// JsonPathExpressionLang ...
JsonPathExpressionLang ExpressionLangType = "jsonpath"

// CELExpressionLang
CELExpressionLang ExpressionLangType = "cel"
)

// BaseWorkflow describes the partial Workflow definition that does not rely on generic interfaces
Expand Down Expand Up @@ -132,7 +136,7 @@ type BaseWorkflow struct {
// +optional
Constants *Constants `json:"constants,omitempty"`
// Identifies the expression language used for workflow expressions. Default is 'jq'.
// +kubebuilder:validation:Enum=jq;jsonpath
// +kubebuilder:validation:Enum=jq;jsonpath;cel
// +kubebuilder:default=jq
// +optional
ExpressionLang ExpressionLangType `json:"expressionLang,omitempty" validate:"required,oneofkind"`
Expand Down
2 changes: 1 addition & 1 deletion model/workflow_validator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ workflow.key required when "workflow.id" is not defined`,
model.BaseWorkflow.ExpressionLang = JqExpressionLang + "invalid"
return *model
},
Err: `workflow.expressionLang need by one of [jq jsonpath]`,
Err: `workflow.expressionLang need by one of [jq jsonpath cel]`,
},
}

Expand Down