Skip to content

Commit ceea13f

Browse files
authored
Set EventRef.ResultEventRef to optional (#239)
* Set EventRef.ResultEventRef to optional Signed-off-by: Dmitrii Tikhomirov <[email protected]> * removed validate declaration and updated tests Signed-off-by: Dmitrii Tikhomirov <[email protected]> --------- Signed-off-by: Dmitrii Tikhomirov <[email protected]>
1 parent b9ff81b commit ceea13f

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

model/event.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ type EventRef struct {
9696
// +kubebuilder:validation:Required
9797
TriggerEventRef string `json:"triggerEventRef" validate:"required"`
9898
// Reference to the unique name of a 'consumed' event definition
99-
// +kubebuilder:validation:Required
100-
ResultEventRef string `json:"resultEventRef" validate:"required"`
99+
// +optional
100+
ResultEventRef string `json:"resultEventRef"`
101101
// Maximum amount of time (ISO 8601 format) to wait for the result event. If not defined it be set to the
102102
// actionExecutionTimeout
103103
// +optional

model/event_validator_test.go

+1-3
Original file line numberDiff line numberDiff line change
@@ -175,11 +175,9 @@ func TestEventRefStructLevelValidation(t *testing.T) {
175175
Model: func() Workflow {
176176
model := baseWorkflow.DeepCopy()
177177
model.States[0].OperationState.Actions[0].EventRef.TriggerEventRef = ""
178-
model.States[0].OperationState.Actions[0].EventRef.ResultEventRef = ""
179178
return *model
180179
},
181-
Err: `workflow.states[0].actions[0].eventRef.triggerEventRef is required
182-
workflow.states[0].actions[0].eventRef.resultEventRef is required`,
180+
Err: `workflow.states[0].actions[0].eventRef.triggerEventRef is required`,
183181
},
184182
{
185183
Desp: "exists",

0 commit comments

Comments
 (0)