Skip to content

Commit

Permalink
wire in the correct dynamic client
Browse files Browse the repository at this point in the history
  • Loading branch information
dprotaso committed Jun 8, 2021
1 parent a018ef9 commit 775321f
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions pkg/reconciler/source/duck/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ limitations under the License.
package duck

import (
"context"
"testing"

"k8s.io/apimachinery/pkg/runtime/schema"
Expand All @@ -26,6 +25,7 @@ import (
// Fake injection informers
_ "knative.dev/eventing/pkg/client/injection/informers/eventing/v1beta1/eventtype/fake"
_ "knative.dev/pkg/client/injection/apiextensions/informers/apiextensions/v1/customresourcedefinition/fake"
sourceinformer "knative.dev/pkg/client/injection/ducks/duck/v1/source"
_ "knative.dev/pkg/client/injection/ducks/duck/v1/source/fake"
fakedynamicclient "knative.dev/pkg/injection/clients/dynamicclient/fake"

Expand All @@ -34,10 +34,13 @@ import (
)

func TestNew(t *testing.T) {
ctx, _ := SetupFakeContext(t, func(ctx context.Context) context.Context {
ctx, _ = fakedynamicclient.With(ctx, NewScheme())
return ctx
})
ctx, _ := SetupFakeContext(t)

// Re-wire some injection so that an informer has a dynamic client
// with the correct scheme
ctx, _ = fakedynamicclient.With(ctx, NewScheme())
ctx, _ = fakedynamicclient.With(ctx, NewScheme())
ctx = sourceinformer.WithDuck(ctx)

gvr := schema.GroupVersionResource{
Group: "testing.sources.knative.dev",
Expand Down

0 comments on commit 775321f

Please sign in to comment.