Skip to content

Commit

Permalink
bugfix: complete json tag for StreamServerReusePort and add some useful
Browse files Browse the repository at this point in the history
log for stop & remove pod operation

Signed-off-by: YaoZengzeng <yaozengzeng@zju.edu.cn>
  • Loading branch information
YaoZengzeng committed Sep 21, 2018
1 parent 2208220 commit 1bf14f0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cri/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ type Config struct {
// StreamServerPort is the port which cri stream server is listening on.
StreamServerPort string `json:"stream-server-port,omitempty"`
// StreamServerReusePort specify whether cri stream server share port with pouchd.
StreamServerReusePort bool
StreamServerReusePort bool `json:"stream-server-reuse-port,omitempty"`
}
4 changes: 4 additions & 0 deletions cri/v1alpha1/cri.go
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,7 @@ func (c *CriManager) StopPodSandbox(ctx context.Context, r *runtime.StopPodSandb
if err != nil {
return nil, fmt.Errorf("failed to stop container %q of sandbox %q: %v", container.ID, podSandboxID, err)
}
logrus.Infof("successfully stop container %q of sandbox %q", container.ID, podSandboxID)
}

container, err := c.ContainerMgr.Get(ctx, podSandboxID)
Expand Down Expand Up @@ -360,6 +361,8 @@ func (c *CriManager) StopPodSandbox(ctx context.Context, r *runtime.StopPodSandb
}
} else if !os.IsNotExist(err) {
return nil, fmt.Errorf("failed to stat network namespace file %s of sandbox %s: %v", sandboxMeta.NetNSPath, podSandboxID, err)
} else {
logrus.Warnf("failed to find network namespace file %s of sandbox %s which may have been already stopped", sandboxMeta.NetNSPath, podSandboxID)
}
}

Expand Down Expand Up @@ -394,6 +397,7 @@ func (c *CriManager) RemovePodSandbox(ctx context.Context, r *runtime.RemovePodS
if err != nil {
return nil, fmt.Errorf("failed to remove container %q of sandbox %q: %v", container.ID, podSandboxID, err)
}
logrus.Infof("successfully remove container %q of sandbox %q", container.ID, podSandboxID)
}

// Remove the sandbox container.
Expand Down
4 changes: 4 additions & 0 deletions cri/v1alpha2/cri.go
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,7 @@ func (c *CriManager) StopPodSandbox(ctx context.Context, r *runtime.StopPodSandb
if err != nil {
return nil, fmt.Errorf("failed to stop container %q of sandbox %q: %v", container.ID, podSandboxID, err)
}
logrus.Infof("successfully stop container %q of sandbox %q", container.ID, podSandboxID)
}

container, err := c.ContainerMgr.Get(ctx, podSandboxID)
Expand Down Expand Up @@ -437,6 +438,8 @@ func (c *CriManager) StopPodSandbox(ctx context.Context, r *runtime.StopPodSandb
}
} else if !os.IsNotExist(err) {
return nil, fmt.Errorf("failed to stat network namespace file %s of sandbox %s: %v", sandboxMeta.NetNSPath, podSandboxID, err)
} else {
logrus.Warnf("failed to find network namespace file %s of sandbox %s which may have been already stopped", sandboxMeta.NetNSPath, podSandboxID)
}
}

Expand Down Expand Up @@ -471,6 +474,7 @@ func (c *CriManager) RemovePodSandbox(ctx context.Context, r *runtime.RemovePodS
if err != nil {
return nil, fmt.Errorf("failed to remove container %q of sandbox %q: %v", container.ID, podSandboxID, err)
}
logrus.Infof("successfully remove container %q of sandbox %q", container.ID, podSandboxID)
}

// Remove the sandbox container.
Expand Down

0 comments on commit 1bf14f0

Please sign in to comment.