Merge pull request #116131 from SataQiu/fix-kubelet-20230228

kubelet: avoid duplicate printing the flag deprecation warnings during re-parsing
This commit is contained in:
Kubernetes Prow Robot 2023-03-09 22:43:41 -08:00 committed by GitHub
commit 352665e290
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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