diff --git a/pkg/internal/source/internal_test.go b/pkg/internal/source/internal_test.go index f71be58424..e25315ffcc 100644 --- a/pkg/internal/source/internal_test.go +++ b/pkg/internal/source/internal_test.go @@ -286,6 +286,15 @@ var _ = Describe("Internal", func() { instance.OnDelete(Foo{}) }) }) + + Describe("Kind", func() { + It("should return kind source type", func() { + kind := internal.Kind[*corev1.Pod]{ + Type: &corev1.Pod{}, + } + Expect(kind.String()).Should(Equal("kind source: *v1.Pod")) + }) + }) }) type Foo struct{} diff --git a/pkg/internal/source/kind.go b/pkg/internal/source/kind.go index 03431d1d24..3a8db96e3c 100644 --- a/pkg/internal/source/kind.go +++ b/pkg/internal/source/kind.go @@ -103,7 +103,7 @@ func (ks *Kind[T]) Start(ctx context.Context, queue workqueue.RateLimitingInterf } func (ks *Kind[T]) String() string { - if isNil(ks.Type) { + if !isNil(ks.Type) { return fmt.Sprintf("kind source: %T", ks.Type) } return "kind source: unknown type"