Skip to content

Commit f3f34fb

Browse files
authored
Merge pull request moby#5399 from thaJeztah/remove_npipe_hack
worker/containerd: NewWorkerOpt: remove workaround for named pipes
2 parents 0cb9ad6 + 84f458e commit f3f34fb

File tree

1 file changed

+4
-20
lines changed

1 file changed

+4
-20
lines changed

worker/containerd/containerd.go

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"context"
55
"os"
66
"path/filepath"
7-
goRuntime "runtime"
87
"strconv"
98
"strings"
109

@@ -48,28 +47,13 @@ type WorkerOptions struct {
4847
}
4948

5049
// NewWorkerOpt creates a WorkerOpt.
51-
func NewWorkerOpt(
52-
workerOpts WorkerOptions,
53-
opts ...containerd.ClientOpt,
54-
) (base.WorkerOpt, error) {
50+
func NewWorkerOpt(workerOpts WorkerOptions, opts ...containerd.ClientOpt) (base.WorkerOpt, error) {
5551
opts = append(opts, containerd.WithDefaultNamespace(workerOpts.Namespace))
56-
57-
address := workerOpts.Address
58-
59-
if goRuntime.GOOS == "windows" {
60-
// TODO(profnandaa): once the upstream PR[1] is merged and
61-
// vendored in buildkit, we will remove this block.
62-
// [1] https://github.com/containerd/containerd/pull/9412
63-
address = strings.TrimPrefix(address, "npipe://")
64-
}
65-
client, err := containerd.New(address, opts...)
52+
client, err := containerd.New(workerOpts.Address, opts...)
6653
if err != nil {
67-
return base.WorkerOpt{}, errors.Wrapf(err, "failed to connect client to %q . make sure containerd is running", address)
54+
return base.WorkerOpt{}, errors.Wrapf(err, "failed to connect client to %q . make sure containerd is running", workerOpts.Address)
6855
}
69-
return newContainerd(
70-
client,
71-
workerOpts,
72-
)
56+
return newContainerd(client, workerOpts)
7357
}
7458

7559
func newContainerd(client *containerd.Client, workerOpts WorkerOptions) (base.WorkerOpt, error) {

0 commit comments

Comments
 (0)