fix: fix failed to get container-shim relation with io.containerd.runc.v1
add '-id' flag when start container with io.containerd.runc.v1 shim, or user can not get container-shim relation from 'ps -ef',like ``` /usr/bin/containerd-shim-runc-v1 -namespace default -address /run/containerd/containerd.sock -publish-binary /usr/bin/containerd ``` Signed-off-by: Ace-Tang <aceapril@126.com>
This commit is contained in:
parent
130d07edd2
commit
c4feaa75cf
@ -110,7 +110,7 @@ type service struct {
|
|||||||
cancel func()
|
cancel func()
|
||||||
}
|
}
|
||||||
|
|
||||||
func newCommand(ctx context.Context, containerdBinary, containerdAddress string) (*exec.Cmd, error) {
|
func newCommand(ctx context.Context, id, containerdBinary, containerdAddress string) (*exec.Cmd, error) {
|
||||||
ns, err := namespaces.NamespaceRequired(ctx)
|
ns, err := namespaces.NamespaceRequired(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@ -125,6 +125,7 @@ func newCommand(ctx context.Context, containerdBinary, containerdAddress string)
|
|||||||
}
|
}
|
||||||
args := []string{
|
args := []string{
|
||||||
"-namespace", ns,
|
"-namespace", ns,
|
||||||
|
"-id", id,
|
||||||
"-address", containerdAddress,
|
"-address", containerdAddress,
|
||||||
"-publish-binary", containerdBinary,
|
"-publish-binary", containerdBinary,
|
||||||
}
|
}
|
||||||
@ -138,7 +139,7 @@ func newCommand(ctx context.Context, containerdBinary, containerdAddress string)
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *service) StartShim(ctx context.Context, id, containerdBinary, containerdAddress string) (string, error) {
|
func (s *service) StartShim(ctx context.Context, id, containerdBinary, containerdAddress string) (string, error) {
|
||||||
cmd, err := newCommand(ctx, containerdBinary, containerdAddress)
|
cmd, err := newCommand(ctx, id, containerdBinary, containerdAddress)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user