From 279febd11b18c2549c34254d43d7b2914ae3b0a0 Mon Sep 17 00:00:00 2001 From: Venera <31911811+venera-program@users.noreply.github.com> Date: Wed, 13 Sep 2023 12:12:02 -0700 Subject: [PATCH] Added CEL to list of valid ExpressionLangs Signed-off-by: Venera <31911811+venera-program@users.noreply.github.com> --- model/workflow.go | 6 +++++- model/workflow_validator_test.go | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/model/workflow.go b/model/workflow.go index 58b382a..f9b23ad 100644 --- a/model/workflow.go +++ b/model/workflow.go @@ -75,6 +75,7 @@ func (i ExpressionLangType) KindValues() []string { return []string{ string(JqExpressionLang), string(JsonPathExpressionLang), + string(CELExpressionLang), } } @@ -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 @@ -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"` diff --git a/model/workflow_validator_test.go b/model/workflow_validator_test.go index 10e935a..eff6154 100644 --- a/model/workflow_validator_test.go +++ b/model/workflow_validator_test.go @@ -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]`, }, }