Fix: suppress klog logs output for vela top

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
This commit is contained in:
Somefive
2023-02-08 14:39:36 +08:00
parent 5dda2d58d7
commit 55662b645a
+4
View File
@@ -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"
@@ -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{