Skip to content

Commit 1a5e0df

Browse files
authored
Merge pull request #2305 from kolyshkin/context
Switch from x/net/context -> context
2 parents e073a48 + bbe14f0 commit 1a5e0df

42 files changed

Lines changed: 309 additions & 206 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

cmd/containerd/command/main.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
package command
1818

1919
import (
20-
"context"
20+
gocontext "context"
2121
"fmt"
2222
"io/ioutil"
2323
golog "log"
@@ -35,7 +35,6 @@ import (
3535
"github.com/pkg/errors"
3636
"github.com/sirupsen/logrus"
3737
"github.com/urfave/cli"
38-
gocontext "golang.org/x/net/context"
3938
"google.golang.org/grpc/grpclog"
4039
)
4140

@@ -168,7 +167,7 @@ func App() *cli.App {
168167
return app
169168
}
170169

171-
func serve(ctx context.Context, l net.Listener, serveFunc func(net.Listener) error) {
170+
func serve(ctx gocontext.Context, l net.Listener, serveFunc func(net.Listener) error) {
172171
path := l.Addr().String()
173172
log.G(ctx).WithField("address", path).Info("serving...")
174173
go func() {

cmd/ctr/commands/shim/shim.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,11 @@
1919
package shim
2020

2121
import (
22+
gocontext "context"
2223
"fmt"
2324
"io/ioutil"
2425
"net"
2526

26-
gocontext "context"
27-
2827
"github.com/containerd/console"
2928
"github.com/containerd/containerd/cmd/ctr/commands"
3029
shim "github.com/containerd/containerd/linux/shim/v1"

grpc.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@
1717
package containerd
1818

1919
import (
20+
"context"
21+
2022
"github.com/containerd/containerd/namespaces"
21-
"golang.org/x/net/context"
2223
"google.golang.org/grpc"
2324
)
2425

leases/grpc.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
package leases
1818

1919
import (
20-
"golang.org/x/net/context"
20+
"context"
21+
2122
"google.golang.org/grpc/metadata"
2223
)
2324

metrics/cgroups/cgroups.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
package cgroups
2020

2121
import (
22+
"context"
23+
2224
"github.com/containerd/cgroups"
2325
eventstypes "github.com/containerd/containerd/api/events"
2426
"github.com/containerd/containerd/events"
@@ -30,7 +32,6 @@ import (
3032
"github.com/containerd/containerd/runtime"
3133
metrics "github.com/docker/go-metrics"
3234
"github.com/sirupsen/logrus"
33-
"golang.org/x/net/context"
3435
)
3536

3637
// Config for the cgroups monitor

namespaces/grpc.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
package namespaces
1818

1919
import (
20-
"golang.org/x/net/context"
20+
"context"
21+
2122
"google.golang.org/grpc/metadata"
2223
)
2324

rootfs/apply.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package rootfs
1818

1919
import (
20+
"context"
2021
"crypto/rand"
2122
"encoding/base64"
2223
"fmt"
@@ -30,7 +31,6 @@ import (
3031
"github.com/opencontainers/image-spec/identity"
3132
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
3233
"github.com/pkg/errors"
33-
"golang.org/x/net/context"
3434
)
3535

3636
// Layer represents the descriptors for a layer diff. These descriptions

rootfs/diff.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@
1717
package rootfs
1818

1919
import (
20+
"context"
2021
"fmt"
2122

2223
"github.com/containerd/containerd/diff"
2324
"github.com/containerd/containerd/mount"
2425
"github.com/containerd/containerd/snapshots"
2526
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
26-
"golang.org/x/net/context"
2727
)
2828

2929
// CreateDiff creates a layer diff for the given snapshot identifier from the

server/server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package server
1818

1919
import (
20+
"context"
2021
"expvar"
2122
"io"
2223
"net"
@@ -37,7 +38,6 @@ import (
3738
metrics "github.com/docker/go-metrics"
3839
grpc_prometheus "github.com/grpc-ecosystem/go-grpc-prometheus"
3940
"github.com/pkg/errors"
40-
"golang.org/x/net/context"
4141

4242
"google.golang.org/grpc"
4343
)

server/server_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
package server
1818

1919
import (
20+
"context"
2021
"testing"
2122

2223
"github.com/gotestyourself/gotestyourself/assert"
2324
is "github.com/gotestyourself/gotestyourself/assert/cmp"
24-
"golang.org/x/net/context"
2525
)
2626

2727
func TestNewErrorsWithSamePathForRootAndState(t *testing.T) {

0 commit comments

Comments
 (0)