Skip to content

Commit

Permalink
accept 'implicit', image defined user and cmd (as well as entrypoint)
Browse files Browse the repository at this point in the history
  • Loading branch information
steiler committed Jun 10, 2021
1 parent f1996a1 commit 4b87dfa
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions runtime/containerd/containerd.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,8 @@ func (c *ContainerdRuntime) CreateContainer(ctx context.Context, node *types.Nod
opts := []oci.SpecOpts{
oci.WithImageConfig(img),
oci.WithEnv(utils.ConvertEnvs(node.Env)),
oci.WithProcessArgs(cmd...),
//oci.WithProcessArgs("bash"),
oci.WithHostname(node.ShortName),
oci.WithUser(node.User),
WithSysctls(node.Sysctls),
//oci.WithAllKnownCapabilities,
oci.WithoutRunMount,
Expand All @@ -144,6 +142,12 @@ func (c *ContainerdRuntime) CreateContainer(ctx context.Context, node *types.Nod
//oci.WithHostDevices,
oci.WithNewPrivileges,
}
if len(cmd) > 0 {
opts = append(opts, oci.WithProcessArgs(cmd...))
}
if node.User != "" {
opts = append(opts, oci.WithUser(node.User))
}

if len(mounts) > 0 {
opts = append(opts, oci.WithMounts(mounts))
Expand Down

0 comments on commit 4b87dfa

Please sign in to comment.