Skip to content

Commit

Permalink
Merge pull request #2809 from k8s-infra-cherrypick-robot/cherry-pick-…
Browse files Browse the repository at this point in the history
…2806-to-release-0.18

[release-0.18] 🐛 correct kind source type
  • Loading branch information
k8s-ci-robot authored May 1, 2024
2 parents d6feaae + 06acde3 commit cd2885e
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 cd2885e

Please sign in to comment.