Skip to content

Commit e8fa916

Browse files
committed
Use the Go SDK context package consistently
Signed-off-by: Stefan Büringer [email protected]
1 parent d9ac3ec commit e8fa916

File tree

7 files changed

+9
-7
lines changed

7 files changed

+9
-7
lines changed

cmd/clusterctl/client/cluster/crd_migration_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ limitations under the License.
1717
package cluster
1818

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

2324
. "github.com/onsi/gomega"
24-
"golang.org/x/net/context"
2525
apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
2626
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2727
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"

controllers/alias.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ limitations under the License.
1717
package controllers
1818

1919
import (
20-
"golang.org/x/net/context"
20+
"context"
21+
2122
ctrl "sigs.k8s.io/controller-runtime"
2223
"sigs.k8s.io/controller-runtime/pkg/client"
2324
"sigs.k8s.io/controller-runtime/pkg/controller"

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ require (
2929
github.com/valyala/fastjson v1.6.3
3030
go.etcd.io/etcd/api/v3 v3.5.4
3131
go.etcd.io/etcd/client/v3 v3.5.4
32-
golang.org/x/net v0.0.0-20220909164309-bea034e7d591
32+
golang.org/x/net v0.0.0-20220909164309-bea034e7d591 // indirect
3333
golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1
3434
google.golang.org/grpc v1.47.0
3535
k8s.io/api v0.25.0

hack/tools/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ require (
1313
github.com/pkg/errors v0.9.1
1414
github.com/spf13/pflag v1.0.5
1515
github.com/valyala/fastjson v1.6.3
16-
golang.org/x/net v0.0.0-20220909164309-bea034e7d591
1716
golang.org/x/tools v0.1.12
1817
google.golang.org/api v0.84.0
1918
helm.sh/helm/v3 v3.9.4
@@ -131,6 +130,7 @@ require (
131130
go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 // indirect
132131
golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e // indirect
133132
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect
133+
golang.org/x/net v0.0.0-20220909164309-bea034e7d591 // indirect
134134
golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1 // indirect
135135
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 // indirect
136136
golang.org/x/sys v0.0.0-20220928140112-f11e5e49a4ec // indirect

hack/tools/tilt-prepare/main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ package main
2222

2323
import (
2424
"bytes"
25+
"context"
2526
"fmt"
2627
"io"
2728
"io/fs"
@@ -35,7 +36,6 @@ import (
3536

3637
"github.com/pkg/errors"
3738
"github.com/spf13/pflag"
38-
"golang.org/x/net/context"
3939
"helm.sh/helm/v3/pkg/repo"
4040
appsv1 "k8s.io/api/apps/v1"
4141
corev1 "k8s.io/api/core/v1"
@@ -379,6 +379,7 @@ func runTaskGroup(ctx context.Context, name string, tasks map[string]taskFunctio
379379

380380
// Create a context to be used for canceling all the tasks when another fails.
381381
ctx, cancel := context.WithCancel(ctx)
382+
defer cancel()
382383

383384
// Make channels to pass fatal errors in WaitGroup
384385
errors := make(chan error)

internal/controllers/topology/cluster/structuredmerge/dryrun.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ limitations under the License.
1717
package structuredmerge
1818

1919
import (
20+
"context"
2021
"encoding/json"
2122

2223
jsonpatch "github.com/evanphx/json-patch/v5"
2324
"github.com/pkg/errors"
24-
"golang.org/x/net/context"
2525
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2626
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
2727
"sigs.k8s.io/controller-runtime/pkg/client"

internal/controllers/topology/cluster/structuredmerge/serversidepathhelper.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ limitations under the License.
1717
package structuredmerge
1818

1919
import (
20+
"context"
2021
"encoding/json"
2122

2223
"github.com/pkg/errors"
23-
"golang.org/x/net/context"
2424
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2525
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
2626
ctrl "sigs.k8s.io/controller-runtime"

0 commit comments

Comments
 (0)