dedupe warning messages for deprecated API warnings
@@ -2,12 +2,14 @@ package kube
import (
"fmt"
+ "os"
apiextensionsclient "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset"
"k8s.io/client-go/dynamic"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest"
"k8s.io/client-go/tools/clientcmd"
+ "k8s.io/kubectl/pkg/util/term"
"sigs.k8s.io/controller-runtime/pkg/client"
"github.com/kudobuilder/kudo/pkg/client/clientset/versioned"
@@ -52,6 +54,7 @@ func GetKubeClient(kubeconfig string) (*Client, error) {
if err != nil {
return nil, err
}
+ config.WarningHandler = rest.NewWarningWriter(os.Stderr, rest.WarningWriterOptions{Deduplicate: true, Color: term.AllowsColorOutput(os.Stderr)})
return GetKubeClientForConfig(config)
}
