Log the command line flags

With d7ddcca231, we lost the logging
of the flags. We should at least log what the command line flags
were used to start processes as those incredibly useful for trouble shooting.
This commit is contained in:
Davanum Srinivas
2018-02-14 11:17:28 -05:00
parent 9a8b675d2c
commit 265e5ae085
16 changed files with 79 additions and 5 deletions

View File

@@ -94,6 +94,7 @@ go_library(
"//pkg/kubelet/types:go_default_library",
"//pkg/util/configz:go_default_library",
"//pkg/util/filesystem:go_default_library",
"//pkg/util/flag:go_default_library",
"//pkg/util/flock:go_default_library",
"//pkg/util/io:go_default_library",
"//pkg/util/mount:go_default_library",

View File

@@ -31,7 +31,6 @@ import (
"path"
"path/filepath"
"strconv"
"strings"
"time"
"github.com/golang/glog"
@@ -84,6 +83,7 @@ import (
kubetypes "k8s.io/kubernetes/pkg/kubelet/types"
"k8s.io/kubernetes/pkg/util/configz"
utilfs "k8s.io/kubernetes/pkg/util/filesystem"
utilflag "k8s.io/kubernetes/pkg/util/flag"
"k8s.io/kubernetes/pkg/util/flock"
kubeio "k8s.io/kubernetes/pkg/util/io"
"k8s.io/kubernetes/pkg/util/mount"
@@ -154,9 +154,7 @@ HTTP server: The kubelet can also listen for HTTP and respond to a simple API
// short-circuit on verflag
verflag.PrintAndExitIfRequested()
// log args (separate lines, so we don't overflow line-length limits in logging infrastructure)
glog.V(2).Infof("kubelet flags: %s", strings.Join(args, "\n"))
utilflag.PrintFlags(cleanFlagSet)
// set feature gates from initial flags-based config
if err := utilfeature.DefaultFeatureGate.SetFromMap(kubeletConfig.FeatureGates); err != nil {