Skip to content

Commit

Permalink
Fix: suppress klog logs output for vela top (#5452)
Browse files Browse the repository at this point in the history
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
(cherry picked from commit 55662b6)

Co-authored-by: Somefive <yd219913@alibaba-inc.com>
  • Loading branch information
github-actions[bot] and Somefive committed Feb 8, 2023
1 parent 191d903 commit f49f11d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions references/cli/top.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ package cli
import (
"fmt"

"github.com/go-logr/logr"
"github.com/spf13/cobra"
"k8s.io/klog/v2"
"sigs.k8s.io/controller-runtime/pkg/log"

"github.com/oam-dev/kubevela/apis/types"
"github.com/oam-dev/kubevela/pkg/utils/common"
Expand Down Expand Up @@ -50,6 +53,7 @@ func NewTopCommand(c common.Args, order string, ioStreams cmdutil.IOStreams) *co
if AllNamespace {
namespace = ""
}
klog.SetLogger(logr.New(log.NullLogSink{}))
return launchUI(c, namespace)
},
Annotations: map[string]string{
Expand Down

0 comments on commit f49f11d

Please sign in to comment.