@@ -27,10 +27,6 @@ import (
27
27
"github.com/andreyvit/diff"
28
28
"github.com/cisco-open/operator-tools/pkg/secret"
29
29
"github.com/cisco-open/operator-tools/pkg/utils"
30
- controllers "github.com/kube-logging/logging-operator/controllers/logging"
31
- "github.com/kube-logging/logging-operator/pkg/resources/fluentd"
32
- "github.com/kube-logging/logging-operator/pkg/sdk/logging/api/v1beta1"
33
- "github.com/kube-logging/logging-operator/pkg/sdk/logging/model/output"
34
30
"github.com/onsi/gomega"
35
31
"github.com/pborman/uuid"
36
32
appsv1 "k8s.io/api/apps/v1"
@@ -43,6 +39,11 @@ import (
43
39
"k8s.io/client-go/kubernetes/scheme"
44
40
ctrl "sigs.k8s.io/controller-runtime"
45
41
"sigs.k8s.io/controller-runtime/pkg/client"
42
+
43
+ controllers "github.com/kube-logging/logging-operator/controllers/logging"
44
+ "github.com/kube-logging/logging-operator/pkg/resources/fluentd"
45
+ "github.com/kube-logging/logging-operator/pkg/sdk/logging/api/v1beta1"
46
+ "github.com/kube-logging/logging-operator/pkg/sdk/logging/model/output"
46
47
)
47
48
48
49
var (
@@ -1217,8 +1218,8 @@ func ensureCreatedEventually(t *testing.T, ns, name string, obj runtime.Object)
1217
1218
t .Fatalf ("unable to cast runtime.Object to client.Object" )
1218
1219
}
1219
1220
1220
- err := wait .Poll ( time .Second , time .Second * 3 , func () (bool , error ) {
1221
- err := mgr .GetClient ().Get (context . TODO () , types.NamespacedName {
1221
+ err := wait .PollUntilContextTimeout ( context . TODO (), time .Second , time .Second * 3 , false , func (ctx context. Context ) (bool , error ) {
1222
+ err := mgr .GetClient ().Get (ctx , types.NamespacedName {
1222
1223
Name : name , Namespace : ns ,
1223
1224
}, object )
1224
1225
if apierrors .IsNotFound (err ) {
@@ -1238,7 +1239,7 @@ func ensureCreatedEventually(t *testing.T, ns, name string, obj runtime.Object)
1238
1239
}
1239
1240
1240
1241
func expectError (t * testing.T , expected string , reconcilerErrors <- chan error ) {
1241
- err := wait .Poll ( time .Second , time .Second * 3 , func () (bool , error ) {
1242
+ err := wait .PollUntilContextTimeout ( context . TODO (), time .Second , time .Second * 3 , false , func (ctx context. Context ) (bool , error ) {
1242
1243
select {
1243
1244
case err := <- reconcilerErrors :
1244
1245
if ! strings .Contains (err .Error (), expected ) {
0 commit comments