mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-29 08:47:56 +00:00
runtime: fix some comments
This commint include two types of fixes for comments in src/runtime/containerd-shim-v2/start.go. - Update comment for calling of watchOOMEvents. - Comments without heading spaces. Fixes: #1750 Signed-off-by: bin <bin@hyper.sh>
This commit is contained in:
parent
db4fbac1d3
commit
f6d5fbf9ba
@ -14,7 +14,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func startContainer(ctx context.Context, s *service, c *container) error {
|
func startContainer(ctx context.Context, s *service, c *container) error {
|
||||||
//start a container
|
// start a container
|
||||||
if c.cType == "" {
|
if c.cType == "" {
|
||||||
err := fmt.Errorf("Bug, the container %s type is empty", c.id)
|
err := fmt.Errorf("Bug, the container %s type is empty", c.id)
|
||||||
return err
|
return err
|
||||||
@ -37,8 +37,8 @@ func startContainer(ctx context.Context, s *service, c *container) error {
|
|||||||
}
|
}
|
||||||
go watchSandbox(ctx, s)
|
go watchSandbox(ctx, s)
|
||||||
|
|
||||||
// We don't rely on the context passed to startContainer as it can be cancelled after
|
// We use s.ctx(`ctx` derived from `s.ctx`) to check for cancellation of the
|
||||||
// this rpc call.
|
// shim context and the context passed to startContainer for tracing.
|
||||||
go watchOOMEvents(ctx, s)
|
go watchOOMEvents(ctx, s)
|
||||||
} else {
|
} else {
|
||||||
_, err := s.sandbox.StartContainer(ctx, c.id)
|
_, err := s.sandbox.StartContainer(ctx, c.id)
|
||||||
@ -74,10 +74,10 @@ func startContainer(ctx context.Context, s *service, c *container) error {
|
|||||||
c.ttyio = tty
|
c.ttyio = tty
|
||||||
go ioCopy(c.exitIOch, c.stdinCloser, tty, stdin, stdout, stderr)
|
go ioCopy(c.exitIOch, c.stdinCloser, tty, stdin, stdout, stderr)
|
||||||
} else {
|
} else {
|
||||||
//close the io exit channel, since there is no io for this container,
|
// close the io exit channel, since there is no io for this container,
|
||||||
//otherwise the following wait goroutine will hang on this channel.
|
// otherwise the following wait goroutine will hang on this channel.
|
||||||
close(c.exitIOch)
|
close(c.exitIOch)
|
||||||
//close the stdin closer channel to notify that it's safe to close process's
|
// close the stdin closer channel to notify that it's safe to close process's
|
||||||
// io.
|
// io.
|
||||||
close(c.stdinCloser)
|
close(c.stdinCloser)
|
||||||
}
|
}
|
||||||
@ -88,7 +88,7 @@ func startContainer(ctx context.Context, s *service, c *container) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func startExec(ctx context.Context, s *service, containerID, execID string) (*exec, error) {
|
func startExec(ctx context.Context, s *service, containerID, execID string) (*exec, error) {
|
||||||
//start an exec
|
// start an exec
|
||||||
c, err := s.getContainer(containerID)
|
c, err := s.getContainer(containerID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
Loading…
Reference in New Issue
Block a user