Skip to content

Commit

Permalink
Merge pull request #7426 from sbueringer/pr-cleanup-contexts
Browse files Browse the repository at this point in the history
🌱 Use the Go SDK context package consistently
  • Loading branch information
k8s-ci-robot authored Oct 18, 2022
2 parents 4b6f3c3 + e8fa916 commit e575705
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion cmd/clusterctl/client/cluster/crd_migration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ limitations under the License.
package cluster

import (
"context"
"fmt"
"testing"

. "github.com/onsi/gomega"
"golang.org/x/net/context"
apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
Expand Down
3 changes: 2 additions & 1 deletion controllers/alias.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ limitations under the License.
package controllers

import (
"golang.org/x/net/context"
"context"

ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/controller"
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ require (
github.com/valyala/fastjson v1.6.3
go.etcd.io/etcd/api/v3 v3.5.4
go.etcd.io/etcd/client/v3 v3.5.4
golang.org/x/net v0.0.0-20220909164309-bea034e7d591
golang.org/x/net v0.0.0-20220909164309-bea034e7d591 // indirect
golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1
google.golang.org/grpc v1.47.0
k8s.io/api v0.25.0
Expand Down
2 changes: 1 addition & 1 deletion hack/tools/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ require (
github.com/pkg/errors v0.9.1
github.com/spf13/pflag v1.0.5
github.com/valyala/fastjson v1.6.3
golang.org/x/net v0.0.0-20220909164309-bea034e7d591
golang.org/x/tools v0.1.12
google.golang.org/api v0.84.0
helm.sh/helm/v3 v3.9.4
Expand Down Expand Up @@ -131,6 +130,7 @@ require (
go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 // indirect
golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e // indirect
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect
golang.org/x/net v0.0.0-20220909164309-bea034e7d591 // indirect
golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1 // indirect
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 // indirect
golang.org/x/sys v0.0.0-20220928140112-f11e5e49a4ec // indirect
Expand Down
3 changes: 2 additions & 1 deletion hack/tools/tilt-prepare/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ package main

import (
"bytes"
"context"
"fmt"
"io"
"io/fs"
Expand All @@ -35,7 +36,6 @@ import (

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

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

// Make channels to pass fatal errors in WaitGroup
errors := make(chan error)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ limitations under the License.
package structuredmerge

import (
"context"
"encoding/json"

jsonpatch "github.com/evanphx/json-patch/v5"
"github.com/pkg/errors"
"golang.org/x/net/context"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"sigs.k8s.io/controller-runtime/pkg/client"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ limitations under the License.
package structuredmerge

import (
"context"
"encoding/json"

"github.com/pkg/errors"
"golang.org/x/net/context"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
ctrl "sigs.k8s.io/controller-runtime"
Expand Down

0 comments on commit e575705

Please sign in to comment.