From bb12914550f61ccb15c709b382347395499c9958 Mon Sep 17 00:00:00 2001 From: Ming Date: Wed, 9 Nov 2022 02:52:21 +0000 Subject: [PATCH] Fix controller problematic log output Signed-off-by: Ming --- changelogs/CHANGELOG-1.9.md | 1 + pkg/util/kube/periodical_enqueue_source.go | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/changelogs/CHANGELOG-1.9.md b/changelogs/CHANGELOG-1.9.md index cf7c4bf676..4c74ddcf4c 100644 --- a/changelogs/CHANGELOG-1.9.md +++ b/changelogs/CHANGELOG-1.9.md @@ -14,6 +14,7 @@ https://velero.io/docs/v1.9/ https://velero.io/docs/v1.9/upgrade-to-1.9/ ### All changes + * Fix controller problematic log output (#5570, @qiuming-best) * Bump up golang version to 1.18.8 (#5558, @qiuming-best) * Enhance the restore priorities list to support specifying the low prioritized resources that need to be restored in the last (#5529, @ywk253100) * Fix v1.9.3 CSI VolumeSnapshot status duplicate issue. (#5518, @blackpiglet) diff --git a/pkg/util/kube/periodical_enqueue_source.go b/pkg/util/kube/periodical_enqueue_source.go index 20b658c61a..e3bb3c7da8 100644 --- a/pkg/util/kube/periodical_enqueue_source.go +++ b/pkg/util/kube/periodical_enqueue_source.go @@ -18,6 +18,7 @@ package kube import ( "context" + "fmt" "reflect" "time" @@ -96,3 +97,10 @@ func (p *PeriodicalEnqueueSource) Start(ctx context.Context, h handler.EventHand return nil } + +func (p *PeriodicalEnqueueSource) String() string { + if p.objList != nil { + return fmt.Sprintf("kind source: %T", p.objList) + } + return "kind source: unknown type" +}