kubelet: avoid duplicate printing the flag deprecation warnings during re-parsing

This commit is contained in:
SataQiu 2023-02-28 22:58:40 +08:00
parent 0e077bb7ac
commit 75ef759810

View File

@ -22,6 +22,7 @@ import (
"crypto/tls"
"errors"
"fmt"
"io"
"math"
"net"
"net/http"
@ -321,6 +322,8 @@ func kubeletConfigFlagPrecedence(kc *kubeletconfiginternal.KubeletConfiguration,
options.AddKubeletConfigFlags(fs, kc)
// Remember original feature gates, so we can merge with flag gates later
original := kc.FeatureGates
// avoid duplicate printing the flag deprecation warnings during re-parsing
fs.SetOutput(io.Discard)
// re-parse flags
if err := fs.Parse(args); err != nil {
return err