From f6300555f4c105f60c5a4cb0a0cdfc01899b833d Mon Sep 17 00:00:00 2001 From: Clayton Coleman Date: Mon, 27 Feb 2017 14:32:40 -0500 Subject: [PATCH] Don't log context or full request URI due to security concerns These lines may contain information that cannot be safely logged to disk. Only deal with known parameters, also bump to V(2) to be consistent with other logging. --- .../k8s.io/apiserver/pkg/endpoints/handlers/rest.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/staging/src/k8s.io/apiserver/pkg/endpoints/handlers/rest.go b/staging/src/k8s.io/apiserver/pkg/endpoints/handlers/rest.go index 8e0dc5a20ca..4fbdc9c1189 100644 --- a/staging/src/k8s.io/apiserver/pkg/endpoints/handlers/rest.go +++ b/staging/src/k8s.io/apiserver/pkg/endpoints/handlers/rest.go @@ -308,12 +308,6 @@ func ListResource(r rest.Lister, rw rest.Watcher, scope RequestScope, forceWatch } if (opts.Watch || forceWatch) && rw != nil { - glog.Infof("Started to log from %v for %v", ctx, req.Request.URL.RequestURI()) - watcher, err := rw.Watch(ctx, &opts) - if err != nil { - scope.err(err, res.ResponseWriter, req.Request) - return - } // TODO: Currently we explicitly ignore ?timeout= and use only ?timeoutSeconds=. timeout := time.Duration(0) if opts.TimeoutSeconds != nil { @@ -322,6 +316,13 @@ func ListResource(r rest.Lister, rw rest.Watcher, scope RequestScope, forceWatch if timeout == 0 && minRequestTimeout > 0 { timeout = time.Duration(float64(minRequestTimeout) * (rand.Float64() + 1.0)) } + glog.V(2).Infof("Starting watch for %s, rv=%s labels=%s fields=%s timeout=%s", req.Request.URL.Path, opts.ResourceVersion, opts.LabelSelector, opts.FieldSelector, timeout) + + watcher, err := rw.Watch(ctx, &opts) + if err != nil { + scope.err(err, res.ResponseWriter, req.Request) + return + } serveWatch(watcher, scope, req, res, timeout) return }