-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Ensure HTTP reconciliation occurs for onExit nodes (#7084)
* fix: Ensure HTTP reconciliation occurs for onExit nodes Signed-off-by: Simon Behar <[email protected]> * tests Signed-off-by: Simon Behar <[email protected]> * fixes Signed-off-by: Simon Behar <[email protected]> * minor Signed-off-by: Simon Behar <[email protected]>
- Loading branch information
Showing
7 changed files
with
158 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package controller | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
|
||
"github.com/argoproj/argo-workflows/v3/pkg/apis/workflow/v1alpha1" | ||
) | ||
|
||
func TestNodeRequiresHttpReconciliation(t *testing.T) { | ||
woc := &wfOperationCtx{ | ||
wf: &v1alpha1.Workflow{ | ||
ObjectMeta: v1.ObjectMeta{ | ||
Name: "test-wf", | ||
}, | ||
Status: v1alpha1.WorkflowStatus{ | ||
Nodes: v1alpha1.Nodes{ | ||
"test-wf-1996333140": v1alpha1.NodeStatus{ | ||
Name: "not-needed", | ||
Type: v1alpha1.NodeTypePod, | ||
}, | ||
"test-wf-3939368189": v1alpha1.NodeStatus{ | ||
Name: "parent", | ||
Type: v1alpha1.NodeTypeSteps, | ||
Children: []string{"child-http"}, | ||
}, | ||
"test-wf-1430055856": v1alpha1.NodeStatus{ | ||
Name: "child-http", | ||
Type: v1alpha1.NodeTypeHTTP, | ||
}, | ||
}, | ||
}, | ||
}, | ||
} | ||
|
||
assert.False(t, woc.nodeRequiresHttpReconciliation("not-needed")) | ||
assert.True(t, woc.nodeRequiresHttpReconciliation("child-http")) | ||
assert.True(t, woc.nodeRequiresHttpReconciliation("parent")) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters