Skip to content

Commit cd2885e

Browse files
authored
Merge pull request #2809 from k8s-infra-cherrypick-robot/cherry-pick-2806-to-release-0.18
[release-0.18] 🐛 correct kind source type
2 parents d6feaae + 06acde3 commit cd2885e

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

pkg/internal/source/internal_test.go

+9
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,15 @@ var _ = Describe("Internal", func() {
286286
instance.OnDelete(Foo{})
287287
})
288288
})
289+
290+
Describe("Kind", func() {
291+
It("should return kind source type", func() {
292+
kind := internal.Kind[*corev1.Pod]{
293+
Type: &corev1.Pod{},
294+
}
295+
Expect(kind.String()).Should(Equal("kind source: *v1.Pod"))
296+
})
297+
})
289298
})
290299

291300
type Foo struct{}

pkg/internal/source/kind.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ func (ks *Kind[T]) Start(ctx context.Context, queue workqueue.RateLimitingInterf
103103
}
104104

105105
func (ks *Kind[T]) String() string {
106-
if isNil(ks.Type) {
106+
if !isNil(ks.Type) {
107107
return fmt.Sprintf("kind source: %T", ks.Type)
108108
}
109109
return "kind source: unknown type"

0 commit comments

Comments
 (0)