Skip to content

Commit de529f0

Browse files
committed
Add break in crd garbage collection loop
Signed-off-by: perdasilva <[email protected]>
1 parent bf784dd commit de529f0

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

Diff for: test/e2e/util/e2e_client.go

+1
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ func (m *E2EKubeClient) GarbageCollectCRDs() error {
9393
if err := m.Client.Delete(context.Background(), &crd); err != nil {
9494
return err
9595
}
96+
break
9697
}
9798
}
9899
}

Diff for: test/e2e/util/e2e_subscription_helper.go

+1-7
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package util
22

33
import (
44
"context"
5-
"encoding/json"
65

76
"github.com/operator-framework/api/pkg/operators/v1alpha1"
87
k8scontrollerclient "sigs.k8s.io/controller-runtime/pkg/client"
@@ -29,7 +28,7 @@ func (s *SubscriptionHelper) EventuallyContainsCondition(expectedCondition v1alp
2928
return nil
3029
}
3130
}
32-
return LogAndFormatError("expected subscription condition %s to be in %s", expectedCondition, subscription.Status.Conditions)
31+
return LogAndFormatError("expected subscription condition %s to be in %s", expectedCondition, ObjectToJsonString(subscription.Status.Conditions))
3332
})
3433
}
3534

@@ -57,8 +56,3 @@ func (s *SubscriptionHelper) waitForSubscriptionToBeLike(checkerFn func(subscrip
5756
return checkerFn(subscription)
5857
})
5958
}
60-
61-
func objectToYamlString(obj interface{}) string {
62-
data, _ := json.Marshal(obj)
63-
return string(data)
64-
}

Diff for: test/e2e/util/test_logging.go

+6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package util
22

33
import (
4+
"encoding/json"
45
"fmt"
56
"strings"
67

@@ -18,3 +19,8 @@ func LogAndFormatError(format string, args ...interface{}) error {
1819
Logf(format, args...)
1920
return fmt.Errorf(format, args...)
2021
}
22+
23+
func ObjectToJsonString(obj interface{}) string {
24+
data, _ := json.Marshal(obj)
25+
return string(data)
26+
}

0 commit comments

Comments
 (0)