Skip to content

Commit

Permalink
docs: conditional forwarding from source is allowed (#1823)
Browse files Browse the repository at this point in the history
Signed-off-by: Keran Yang <[email protected]>
  • Loading branch information
KeranYang authored Jul 12, 2024
1 parent 41e7878 commit 54a5f77
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 10 deletions.
4 changes: 2 additions & 2 deletions api/json-schema/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -17812,7 +17812,7 @@
"properties": {
"conditions": {
"$ref": "#/definitions/io.numaproj.numaflow.v1alpha1.ForwardConditions",
"description": "Conditional forwarding, only allowed when \"From\" is a Sink or UDF."
"description": "Conditional forwarding, only allowed when \"From\" is a Source or UDF."
},
"from": {
"type": "string"
Expand Down Expand Up @@ -18016,7 +18016,7 @@
"properties": {
"conditions": {
"$ref": "#/definitions/io.numaproj.numaflow.v1alpha1.ForwardConditions",
"description": "Conditional forwarding, only allowed when \"From\" is a Sink or UDF."
"description": "Conditional forwarding, only allowed when \"From\" is a Source or UDF."
},
"from": {
"type": "string"
Expand Down
4 changes: 2 additions & 2 deletions api/openapi-spec/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -17822,7 +17822,7 @@
],
"properties": {
"conditions": {
"description": "Conditional forwarding, only allowed when \"From\" is a Sink or UDF.",
"description": "Conditional forwarding, only allowed when \"From\" is a Source or UDF.",
"$ref": "#/definitions/io.numaproj.numaflow.v1alpha1.ForwardConditions"
},
"from": {
Expand Down Expand Up @@ -18024,7 +18024,7 @@
],
"properties": {
"conditions": {
"description": "Conditional forwarding, only allowed when \"From\" is a Sink or UDF.",
"description": "Conditional forwarding, only allowed when \"From\" is a Source or UDF.",
"$ref": "#/definitions/io.numaproj.numaflow.v1alpha1.ForwardConditions"
},
"from": {
Expand Down
2 changes: 1 addition & 1 deletion docs/APIs.md
Original file line number Diff line number Diff line change
Expand Up @@ -1794,7 +1794,7 @@ ForwardConditions </a> </em>
<em>(Optional)</em>
<p>

Conditional forwarding, only allowed when “From” is a Sink or UDF.
Conditional forwarding, only allowed when “From” is a Source or UDF.
</p>

</td>
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/numaflow/v1alpha1/edge_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import "fmt"
type Edge struct {
From string `json:"from" protobuf:"bytes,1,opt,name=from"`
To string `json:"to" protobuf:"bytes,2,opt,name=to"`
// Conditional forwarding, only allowed when "From" is a Sink or UDF.
// Conditional forwarding, only allowed when "From" is a Source or UDF.
// +optional
Conditions *ForwardConditions `json:"conditions" protobuf:"bytes,3,opt,name=conditions"`
// OnFull specifies the behaviour for the write actions when the inter step buffer is full.
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/numaflow/v1alpha1/generated.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pkg/apis/numaflow/v1alpha1/openapi_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion pkg/reconciler/pipeline/validate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -511,9 +511,12 @@ func TestValidatePipeline(t *testing.T) {
assert.NoError(t, err)
})

t.Run("allow conditional forwarding from source vertex", func(t *testing.T) {
t.Run("allow conditional forwarding from source vertex or udf vertex", func(t *testing.T) {
testObj := testPipeline.DeepCopy()
operatorOr := dfv1.LogicOperatorOr
testObj.Spec.Edges[0].Conditions = &dfv1.ForwardConditions{Tags: &dfv1.TagConditions{
Operator: &operatorOr,
Values: []string{"hello"}}}
testObj.Spec.Edges[1].Conditions = &dfv1.ForwardConditions{Tags: &dfv1.TagConditions{
Operator: &operatorOr,
Values: []string{"hello"}}}
Expand Down

0 comments on commit 54a5f77

Please sign in to comment.