Skip to content
This repository was archived by the owner on Mar 9, 2022. It is now read-only.

Commit b33f16e

Browse files
committed
Don't log config at info level.
Signed-off-by: Lantao Liu <[email protected]>
1 parent 71909a1 commit b33f16e

3 files changed

Lines changed: 7 additions & 4 deletions

File tree

pkg/server/container_create.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ func init() {
7777
// CreateContainer creates a new container in the given PodSandbox.
7878
func (c *criService) CreateContainer(ctx context.Context, r *runtime.CreateContainerRequest) (_ *runtime.CreateContainerResponse, retErr error) {
7979
config := r.GetConfig()
80+
logrus.Debugf("Container config %+v", config)
8081
sandboxConfig := r.GetSandboxConfig()
8182
sandbox, err := c.sandboxStore.Get(r.GetPodSandboxId())
8283
if err != nil {

pkg/server/instrumented_service.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func (in *instrumentedService) RunPodSandbox(ctx context.Context, r *runtime.Run
5252
if err := in.checkInitialized(); err != nil {
5353
return nil, err
5454
}
55-
logrus.Infof("RunPodSandbox with config %+v", r.GetConfig())
55+
logrus.Infof("RunPodsandbox for %+v", r.GetConfig().GetMetadata())
5656
defer func() {
5757
if err != nil {
5858
logrus.WithError(err).Errorf("RunPodSandbox for %+v failed, error", r.GetConfig().GetMetadata())
@@ -142,8 +142,8 @@ func (in *instrumentedService) CreateContainer(ctx context.Context, r *runtime.C
142142
if err := in.checkInitialized(); err != nil {
143143
return nil, err
144144
}
145-
logrus.Infof("CreateContainer within sandbox %q with container config %+v and sandbox config %+v",
146-
r.GetPodSandboxId(), r.GetConfig(), r.GetSandboxConfig())
145+
logrus.Infof("CreateContainer within sandbox %q for container %+v",
146+
r.GetPodSandboxId(), r.GetConfig().GetMetadata())
147147
defer func() {
148148
if err != nil {
149149
logrus.WithError(err).Errorf("CreateContainer within sandbox %q for %+v failed",

pkg/server/sandbox_run.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import (
2828
"github.com/containerd/containerd/oci"
2929
cni "github.com/containerd/go-cni"
3030
"github.com/containerd/typeurl"
31+
"github.com/davecgh/go-spew/spew"
3132
imagespec "github.com/opencontainers/image-spec/specs-go/v1"
3233
runtimespec "github.com/opencontainers/runtime-spec/specs-go"
3334
"github.com/pkg/errors"
@@ -54,6 +55,7 @@ func init() {
5455
// the sandbox is in ready state.
5556
func (c *criService) RunPodSandbox(ctx context.Context, r *runtime.RunPodSandboxRequest) (_ *runtime.RunPodSandboxResponse, retErr error) {
5657
config := r.GetConfig()
58+
logrus.Debugf("Sandbox config %+v", config)
5759

5860
// Generate unique id and name for the sandbox and reserve the name.
5961
id := util.GenerateID()
@@ -142,7 +144,7 @@ func (c *criService) RunPodSandbox(ctx context.Context, r *runtime.RunPodSandbox
142144
if err != nil {
143145
return nil, errors.Wrap(err, "failed to generate sandbox container spec")
144146
}
145-
logrus.Debugf("Sandbox container spec: %+v", spec)
147+
logrus.Debugf("Sandbox container %q spec: %#+v", id, spew.NewFormatter(spec))
146148

147149
var specOpts []oci.SpecOpts
148150
userstr, err := generateUserString(

0 commit comments

Comments
 (0)