Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge c66b03f into 72ea3cd
Browse files Browse the repository at this point in the history
valaparthvi authored Apr 13, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
2 parents 72ea3cd + c66b03f commit da41036
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pkg/kclient/kclient.go
Original file line number Diff line number Diff line change
@@ -2,6 +2,8 @@ package kclient

import (
"fmt"
"github.com/redhat-developer/odo/pkg/log"
"k8s.io/kubectl/pkg/util/term"
"strings"

"k8s.io/cli-runtime/pkg/genericclioptions"
@@ -127,6 +129,14 @@ func NewForConfig(config clientcmd.ClientConfig) (client *Client, err error) {
client.KubeClientConfig.QPS = defaultQPS
client.KubeClientConfig.Burst = defaultBurst

// This warning handler ensures that warnings are not duplicated
client.KubeClientConfig.WarningHandler = rest.NewWarningWriter(log.GetStderr(), rest.WarningWriterOptions{
// only print a given warning the first time we receive it
Deduplicate: true,
// highlight the output with color when the output supports it
Color: term.AllowsColorOutput(log.GetStderr()),
})

client.KubeClient, err = kubernetes.NewForConfig(client.KubeClientConfig)
if err != nil {
return nil, err

0 comments on commit da41036

Please sign in to comment.