integration: rename "/opt/containerd-1.0/bin/containerd" worker to "containerd-1.0"

Having '/' in a worker name is confusing.

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
docker-18.09
Akihiro Suda 2018-07-06 15:16:38 +09:00
parent cda0a64eca
commit 864fa7465e
3 changed files with 28 additions and 9 deletions

View File

@ -256,7 +256,7 @@ make test TESTPKGS=./client
make test TESTPKGS=./client TESTFLAGS="--run /TestCallDiskUsage -v"
# run all integration tests with a specific worker
# supported workers are oci and containerd
# supported workers: oci, oci-rootless, containerd, containerd-1.0
make test TESTPKGS=./client TESTFLAGS="--run //worker=containerd -v"
```

View File

@ -93,6 +93,7 @@ RUN apk add --no-cache shadow shadow-uidmap sudo \
&& echo "XDG_RUNTIME_DIR=/run/user/1000; export XDG_RUNTIME_DIR" >> /home/user/.profile \
&& mkdir -m 0700 -p /run/user/1000 \
&& chown -R user /run/user/1000 /home/user
ENV BUILDKIT_INTEGRATION_CONTAINERD_EXTRA="containerd-1.0=/opt/containerd-1.0/bin"
COPY --from=containerd10 /go/src/github.com/containerd/containerd/bin/containerd* /opt/containerd-1.0/bin/
COPY --from=buildctl /usr/bin/buildctl /usr/bin/
COPY --from=buildkitd /usr/bin/buildkitd /usr/bin

View File

@ -7,27 +7,45 @@ import (
"os"
"os/exec"
"path/filepath"
"strings"
"time"
"github.com/pkg/errors"
)
func init() {
// empty value stands for system-wide PATH, which would contain containerd v1.1.
paths := []string{"", "/opt/containerd-1.0/bin"}
for _, path := range paths {
register(&containerd{
containerd: filepath.Join(path, "containerd"),
containerdShim: filepath.Join(path, "containerd-shim"),
})
register(&containerd{
name: "containerd",
containerd: "containerd",
containerdShim: "containerd-shim",
})
// defined in hack/dockerfiles/test.Dockerfile.
// e.g. `containerd-1.0=/opt/containerd-1.0/bin,containerd-42.0=/opt/containerd-42.0/bin`
if s := os.Getenv("BUILDKIT_INTEGRATION_CONTAINERD_EXTRA"); s != "" {
entries := strings.Split(s, ",")
for _, entry := range entries {
pair := strings.Split(strings.TrimSpace(entry), "=")
if len(pair) != 2 {
panic(errors.Errorf("unexpected BUILDKIT_INTEGRATION_CONTAINERD_EXTRA: %q", s))
}
name, bin := pair[0], pair[1]
register(&containerd{
name: name,
containerd: filepath.Join(bin, "containerd"),
containerdShim: filepath.Join(bin, "containerd-shim"),
})
}
}
}
type containerd struct {
name string
containerd string
containerdShim string
}
func (c *containerd) Name() string {
return c.containerd
return c.name
}
func (c *containerd) New() (sb Sandbox, cl func() error, err error) {