Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mattia-fumo committed Mar 8, 2024
1 parent 394dfb0 commit 6301356
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
20 changes: 11 additions & 9 deletions pkg/deploy/apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,16 +159,18 @@ func withAwaitableResource(apply applyFunction) applyFunction {
obj, err := clients.dynamic.Resource(gvr).
Namespace(res.Object.GetNamespace()).
Get(context.TODO(), res.Object.GetName(), metav1.GetOptions{})
isCompleted, err := handleResourceCompletionEvent(res, &watch.Event{
Type: watch.Modified,
Object: obj,
}, startTime)
if err != nil {
return err
}
if err == nil {
isCompleted, err := handleResourceCompletionEvent(res, &watch.Event{
Type: watch.Modified,
Object: obj,
}, startTime)
if err != nil {
return err
}

if isCompleted {
return nil
if isCompleted {
return nil
}
}

msg := fmt.Sprintf("Timeout received while waiting for resource %s completion", res.Object.GetName())
Expand Down
2 changes: 1 addition & 1 deletion pkg/deploy/apply_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ func TestWithAwaitableResource(t *testing.T) {
watcherEvents: []unstructured.Unstructured{},
errorRequire: require.Nil,
}, {
desc: "Ignores annotated resources compelted before start time",
desc: "Ignores annotated resources completed before start time",
resFileName: "testdata/awaitable-job.yaml",
watcherEvents: []unstructured.Unstructured{
{
Expand Down

0 comments on commit 6301356

Please sign in to comment.