Skip to content

Commit

Permalink
Use the non-deprecated logr test (#2125)
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Eckert authored May 12, 2023
1 parent b4f7431 commit e26a53a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@ package controllers

import (
"context"
gwv1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1"
"testing"
"time"

logrtest "github.com/go-logr/logr/testing"
logrtest "github.com/go-logr/logr/testr"
"github.com/hashicorp/consul-k8s/control-plane/api/v1alpha1"
"github.com/stretchr/testify/require"
meta "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand All @@ -18,6 +17,7 @@ import (
"k8s.io/apimachinery/pkg/types"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client/fake"
gwv1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1"
)

func TestGatewayClassConfigSetup(t *testing.T) {
Expand Down Expand Up @@ -102,7 +102,7 @@ func TestGatewayClassConfigReconcile(t *testing.T) {
// Create the gateway class config controller.
gcc := &GatewayClassConfigController{
Client: fakeClient,
Log: logrtest.NewTestLogger(t),
Log: logrtest.New(t),
}

resp, err := gcc.Reconcile(context.Background(), ctrl.Request{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ package controllers

import (
"context"
"sigs.k8s.io/controller-runtime/pkg/reconcile"
"testing"

logrtest "github.com/go-logr/logr/testing"
"sigs.k8s.io/controller-runtime/pkg/reconcile"

logrtest "github.com/go-logr/logr/testr"
"github.com/hashicorp/consul-k8s/control-plane/api/v1alpha1"
"github.com/stretchr/testify/require"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down Expand Up @@ -86,7 +87,7 @@ func TestGatewayReconciler(t *testing.T) {

r := &GatewayController{
Client: fakeClient,
Log: logrtest.NewTestLogger(t),
Log: logrtest.New(t),
}
result, err := r.Reconcile(context.Background(), req)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"testing"

logrtest "github.com/go-logr/logr/testing"
logrtest "github.com/go-logr/logr/testr"
"github.com/hashicorp/consul-k8s/control-plane/api/v1alpha1"
"github.com/stretchr/testify/require"
apierrors "k8s.io/apimachinery/pkg/api/errors"
Expand Down Expand Up @@ -239,7 +239,7 @@ func TestGatewayClassReconciler(t *testing.T) {
r := &GatewayClassController{
Client: fakeClient,
ControllerName: GatewayClassControllerName,
Log: logrtest.NewTestLogger(t),
Log: logrtest.New(t),
}
result, err := r.Reconcile(context.Background(), req)

Expand Down

0 comments on commit e26a53a

Please sign in to comment.