Skip to content

Commit b27bdb9

Browse files
committed
chore: lint fix
Signed-off-by: Peter Wilcsinszky <[email protected]>
1 parent c5a5996 commit b27bdb9

File tree

2 files changed

+47
-7
lines changed

2 files changed

+47
-7
lines changed

controllers/logging/logging_controller_test.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@ import (
2727
"github.com/andreyvit/diff"
2828
"github.com/cisco-open/operator-tools/pkg/secret"
2929
"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"
3430
"github.com/onsi/gomega"
3531
"github.com/pborman/uuid"
3632
appsv1 "k8s.io/api/apps/v1"
@@ -43,6 +39,11 @@ import (
4339
"k8s.io/client-go/kubernetes/scheme"
4440
ctrl "sigs.k8s.io/controller-runtime"
4541
"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"
4647
)
4748

4849
var (
@@ -1217,8 +1218,8 @@ func ensureCreatedEventually(t *testing.T, ns, name string, obj runtime.Object)
12171218
t.Fatalf("unable to cast runtime.Object to client.Object")
12181219
}
12191220

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{
12221223
Name: name, Namespace: ns,
12231224
}, object)
12241225
if apierrors.IsNotFound(err) {
@@ -1238,7 +1239,7 @@ func ensureCreatedEventually(t *testing.T, ns, name string, obj runtime.Object)
12381239
}
12391240

12401241
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) {
12421243
select {
12431244
case err := <-reconcilerErrors:
12441245
if !strings.Contains(err.Error(), expected) {

0 commit comments

Comments
 (0)