Skip to content

Commit 1f5b84f

Browse files
committed
[CRI] Reduce clutter of log entries during process execution
Signed-off-by: Davanum Srinivas <[email protected]>
1 parent 18ad79d commit 1f5b84f

4 files changed

Lines changed: 11 additions & 11 deletions

File tree

pkg/cri/io/container_io.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ func (c *ContainerIO) Pipe() {
114114
c.stdout.Close()
115115
c.stdoutGroup.Close()
116116
wg.Done()
117-
logrus.Infof("Finish piping stdout of container %q", c.id)
117+
logrus.Debugf("Finish piping stdout of container %q", c.id)
118118
}()
119119
}
120120

@@ -127,7 +127,7 @@ func (c *ContainerIO) Pipe() {
127127
c.stderr.Close()
128128
c.stderrGroup.Close()
129129
wg.Done()
130-
logrus.Infof("Finish piping stderr of container %q", c.id)
130+
logrus.Debugf("Finish piping stderr of container %q", c.id)
131131
}()
132132
}
133133
}

pkg/cri/io/exec_io.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ func (e *ExecIO) Attach(opts AttachOptions) <-chan struct{} {
9999
}
100100
e.closer.wg.Done()
101101
wg.Done()
102-
logrus.Infof("Finish piping %q of container exec %q", t, e.id)
102+
logrus.Debugf("Finish piping %q of container exec %q", t, e.id)
103103
}
104104

105105
if opts.Stdout != nil {

pkg/cri/server/container_execsync.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,14 +164,14 @@ func (c *criService) execInternal(ctx context.Context, container containerd.Cont
164164
}
165165
// Wait for the process to be killed.
166166
exitRes := <-exitCh
167-
log.G(ctx).Infof("Timeout received while waiting for exec process kill %q code %d and error %v",
167+
log.G(ctx).Debugf("Timeout received while waiting for exec process kill %q code %d and error %v",
168168
execID, exitRes.ExitCode(), exitRes.Error())
169169
<-attachDone
170170
log.G(ctx).Debugf("Stream pipe for exec process %q done", execID)
171171
return nil, errors.Wrapf(execCtx.Err(), "timeout %v exceeded", opts.timeout)
172172
case exitRes := <-exitCh:
173173
code, _, err := exitRes.Result()
174-
log.G(ctx).Infof("Exec process %q exits with exit code %d and error %v", execID, code, err)
174+
log.G(ctx).Debugf("Exec process %q exits with exit code %d and error %v", execID, code, err)
175175
if err != nil {
176176
return nil, errors.Wrapf(err, "failed while waiting for exec %q", execID)
177177
}

pkg/cri/server/instrumented_service.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -247,12 +247,12 @@ func (in *instrumentedService) ExecSync(ctx context.Context, r *runtime.ExecSync
247247
if err := in.checkInitialized(); err != nil {
248248
return nil, err
249249
}
250-
log.G(ctx).Infof("ExecSync for %q with command %+v and timeout %d (s)", r.GetContainerId(), r.GetCmd(), r.GetTimeout())
250+
log.G(ctx).Debugf("ExecSync for %q with command %+v and timeout %d (s)", r.GetContainerId(), r.GetCmd(), r.GetTimeout())
251251
defer func() {
252252
if err != nil {
253253
log.G(ctx).WithError(err).Errorf("ExecSync for %q failed", r.GetContainerId())
254254
} else {
255-
log.G(ctx).Infof("ExecSync for %q returns with exit code %d", r.GetContainerId(), res.GetExitCode())
255+
log.G(ctx).Debugf("ExecSync for %q returns with exit code %d", r.GetContainerId(), res.GetExitCode())
256256
log.G(ctx).Debugf("ExecSync for %q outputs - stdout: %q, stderr: %q", r.GetContainerId(),
257257
res.GetStdout(), res.GetStderr())
258258
}
@@ -265,13 +265,13 @@ func (in *instrumentedService) Exec(ctx context.Context, r *runtime.ExecRequest)
265265
if err := in.checkInitialized(); err != nil {
266266
return nil, err
267267
}
268-
log.G(ctx).Infof("Exec for %q with command %+v, tty %v and stdin %v",
268+
log.G(ctx).Debugf("Exec for %q with command %+v, tty %v and stdin %v",
269269
r.GetContainerId(), r.GetCmd(), r.GetTty(), r.GetStdin())
270270
defer func() {
271271
if err != nil {
272272
log.G(ctx).WithError(err).Errorf("Exec for %q failed", r.GetContainerId())
273273
} else {
274-
log.G(ctx).Infof("Exec for %q returns URL %q", r.GetContainerId(), res.GetUrl())
274+
log.G(ctx).Debugf("Exec for %q returns URL %q", r.GetContainerId(), res.GetUrl())
275275
}
276276
}()
277277
res, err = in.c.Exec(ctrdutil.WithNamespace(ctx), r)
@@ -282,12 +282,12 @@ func (in *instrumentedService) Attach(ctx context.Context, r *runtime.AttachRequ
282282
if err := in.checkInitialized(); err != nil {
283283
return nil, err
284284
}
285-
log.G(ctx).Infof("Attach for %q with tty %v and stdin %v", r.GetContainerId(), r.GetTty(), r.GetStdin())
285+
log.G(ctx).Debugf("Attach for %q with tty %v and stdin %v", r.GetContainerId(), r.GetTty(), r.GetStdin())
286286
defer func() {
287287
if err != nil {
288288
log.G(ctx).WithError(err).Errorf("Attach for %q failed", r.GetContainerId())
289289
} else {
290-
log.G(ctx).Infof("Attach for %q returns URL %q", r.GetContainerId(), res.Url)
290+
log.G(ctx).Debugf("Attach for %q returns URL %q", r.GetContainerId(), res.Url)
291291
}
292292
}()
293293
res, err = in.c.Attach(ctrdutil.WithNamespace(ctx), r)

0 commit comments

Comments
 (0)