mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 19:01:49 +00:00
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:
commit
352665e290
@ -22,6 +22,7 @@ import (
|
|||||||
"crypto/tls"
|
"crypto/tls"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"io"
|
||||||
"math"
|
"math"
|
||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
@ -321,6 +322,8 @@ func kubeletConfigFlagPrecedence(kc *kubeletconfiginternal.KubeletConfiguration,
|
|||||||
options.AddKubeletConfigFlags(fs, kc)
|
options.AddKubeletConfigFlags(fs, kc)
|
||||||
// Remember original feature gates, so we can merge with flag gates later
|
// Remember original feature gates, so we can merge with flag gates later
|
||||||
original := kc.FeatureGates
|
original := kc.FeatureGates
|
||||||
|
// avoid duplicate printing the flag deprecation warnings during re-parsing
|
||||||
|
fs.SetOutput(io.Discard)
|
||||||
// re-parse flags
|
// re-parse flags
|
||||||
if err := fs.Parse(args); err != nil {
|
if err := fs.Parse(args); err != nil {
|
||||||
return err
|
return err
|
||||||
|
Loading…
Reference in New Issue
Block a user