Skip to content

Commit

Permalink
Merge pull request kubernetes-sigs#2806 from terinjokes/terin/kind-st…
Browse files Browse the repository at this point in the history
…ring

🐛 correct kind source type
  • Loading branch information
k8s-ci-robot committed May 1, 2024
2 parents d9f479e + 4c19a76 commit 9bc967a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions pkg/internal/source/internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}
Expand Down
2 changes: 1 addition & 1 deletion pkg/internal/source/kind.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 9bc967a

Please sign in to comment.