Skip to content

Commit a657d6c

Browse files
Fix review comments.
1 parent 947c05e commit a657d6c

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ More detailed instructions are in the [`example README.md`](https://github.com/R
9595
| **image** | string | yes | OCI image (docker is also OCI compatible) for your container. |
9696
| **command** | string | no | Command to override command defined in the image. |
9797
| **args** | []string | no | Arguments to the command. |
98-
| **entrypoint** | string | no | Overwrite the default ENTRYPOINT of the image. |
98+
| **entrypoint** | []string | no | A string list overriding the image's entrypoint. |
9999
| **cwd** | string | no | Specify the current working directory for your container process. If the directory does not exist, one will be created for you. |
100100
| **privileged** | bool | no | Run container in privileged mode. Your container will have all linux capabilities when running in privileged mode. |
101101
| **host_dns** | bool | no | Default (`true`). By default, a container launched using `containerd-driver` will use host `/etc/resolv.conf`. This is similar to [`docker behavior`](https://docs.docker.com/config/containers/container-networking/#dns-services). However, if you don't want to use host DNS, you can turn off this flag by setting `host_dns=false`. |

containerd/containerd.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,16 +76,16 @@ func (d *Driver) pullImage(imageName string) (containerd.Image, error) {
7676
}
7777

7878
func (d *Driver) createContainer(containerConfig *ContainerConfig, config *TaskConfig) (containerd.Container, error) {
79-
if config.Command != "" && config.Entrypoint != "" {
79+
if config.Command != "" && config.Entrypoint != nil {
8080
return nil, fmt.Errorf("Both command and entrypoint are set. Only one of them needs to be set.")
8181
}
8282

8383
// Entrypoint or Command set by the user, to override entrypoint or cmd defined in the image.
8484
var args []string
8585
if config.Command != "" {
8686
args = append(args, config.Command)
87-
} else if config.Entrypoint != "" {
88-
args = append(args, config.Entrypoint)
87+
} else if config.Entrypoint != nil && config.Entrypoint[0] != "" {
88+
args = append(args, config.Entrypoint...)
8989
}
9090

9191
// Arguments to the command set by the user.
@@ -95,7 +95,7 @@ func (d *Driver) createContainer(containerConfig *ContainerConfig, config *TaskC
9595

9696
var opts []oci.SpecOpts
9797

98-
if config.Entrypoint != "" {
98+
if config.Entrypoint != nil {
9999
opts = append(opts, oci.WithProcessArgs(args...))
100100
} else {
101101
opts = append(opts, oci.WithImageConfigArgs(containerConfig.Image, args))

containerd/driver.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ var (
103103
hclspec.NewLiteral("true"),
104104
),
105105
"extra_hosts": hclspec.NewAttr("extra_hosts", "list(string)", false),
106-
"entrypoint": hclspec.NewAttr("entrypoint", "string", false),
106+
"entrypoint": hclspec.NewAttr("entrypoint", "list(string)", false),
107107
"seccomp": hclspec.NewAttr("seccomp", "bool", false),
108108
"seccomp_profile": hclspec.NewAttr("seccomp_profile", "string", false),
109109
"readonly_rootfs": hclspec.NewAttr("readonly_rootfs", "bool", false),
@@ -162,7 +162,7 @@ type TaskConfig struct {
162162
Privileged bool `codec:"privileged"`
163163
HostDNS bool `codec:"host_dns"`
164164
ExtraHosts []string `codec:"extra_hosts"`
165-
Entrypoint string `codec:"entrypoint"`
165+
Entrypoint []string `codec:"entrypoint"`
166166
ReadOnlyRootfs bool `codec:"readonly_rootfs"`
167167
HostNetwork bool `codec:"host_network"`
168168
Mounts []Mount `codec:"mounts"`

0 commit comments

Comments
 (0)