Skip to content

Commit

Permalink
Switch to the crossplane-runtime pkg/errors package
Browse files Browse the repository at this point in the history
See crossplane/crossplane-runtime#291 for context.

Signed-off-by: Nic Cope <negz@rk0n.org>
  • Loading branch information
negz committed Sep 15, 2021
1 parent 1898960 commit f5b8818
Show file tree
Hide file tree
Showing 67 changed files with 111 additions and 88 deletions.
3 changes: 2 additions & 1 deletion apis/compute/v1alpha1/referencers.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ package v1alpha1
import (
"context"

"github.com/pkg/errors"
"sigs.k8s.io/controller-runtime/pkg/client"

"github.com/crossplane/crossplane-runtime/pkg/errors"

"github.com/crossplane/crossplane-runtime/pkg/reference"

"github.com/crossplane/provider-gcp/apis/compute/v1beta1"
Expand Down
3 changes: 2 additions & 1 deletion apis/compute/v1beta1/referencers.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ import (
"context"
"strings"

"github.com/pkg/errors"
"sigs.k8s.io/controller-runtime/pkg/client"

"github.com/crossplane/crossplane-runtime/pkg/errors"

"github.com/crossplane/crossplane-runtime/pkg/reference"
"github.com/crossplane/crossplane-runtime/pkg/resource"
)
Expand Down
3 changes: 2 additions & 1 deletion apis/container/v1beta1/referencers.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ package v1beta1
import (
"context"

"github.com/pkg/errors"
"sigs.k8s.io/controller-runtime/pkg/client"

"github.com/crossplane/crossplane-runtime/pkg/errors"

"github.com/crossplane/crossplane-runtime/pkg/reference"

"github.com/crossplane/provider-gcp/apis/container/v1beta2"
Expand Down
3 changes: 2 additions & 1 deletion apis/container/v1beta2/referencers.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ import (
"context"
"strings"

"github.com/pkg/errors"
"sigs.k8s.io/controller-runtime/pkg/client"

"github.com/crossplane/crossplane-runtime/pkg/errors"

"github.com/crossplane/crossplane-runtime/pkg/reference"
resource "github.com/crossplane/crossplane-runtime/pkg/resource"

Expand Down
3 changes: 2 additions & 1 deletion apis/database/v1beta1/referencers.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ package v1beta1
import (
"context"

"github.com/pkg/errors"
"sigs.k8s.io/controller-runtime/pkg/client"

"github.com/crossplane/crossplane-runtime/pkg/errors"

"github.com/crossplane/crossplane-runtime/pkg/reference"

"github.com/crossplane/provider-gcp/apis/compute/v1beta1"
Expand Down
5 changes: 3 additions & 2 deletions apis/iam/v1alpha1/referencers.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@ import (
"context"
"fmt"

"sigs.k8s.io/controller-runtime/pkg/client"

xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1"
"github.com/crossplane/crossplane-runtime/pkg/errors"
"github.com/crossplane/crossplane-runtime/pkg/reference"
"github.com/crossplane/crossplane-runtime/pkg/resource"
"github.com/pkg/errors"
"sigs.k8s.io/controller-runtime/pkg/client"
)

// ServiceAccountReferer defines a reference to a ServiceAccount either via its RRN,
Expand Down
5 changes: 3 additions & 2 deletions apis/iam/v1alpha1/referencers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@ import (
"context"
"testing"

xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1"
"github.com/crossplane/crossplane-runtime/pkg/resource"
"github.com/google/go-cmp/cmp"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/client/fake"

xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1"
"github.com/crossplane/crossplane-runtime/pkg/resource"
)

const (
Expand Down
3 changes: 2 additions & 1 deletion apis/kms/v1alpha1/referencers.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ package v1alpha1
import (
"context"

"github.com/pkg/errors"
"sigs.k8s.io/controller-runtime/pkg/client"

"github.com/crossplane/crossplane-runtime/pkg/errors"

"github.com/crossplane/crossplane-runtime/pkg/reference"
"github.com/crossplane/crossplane-runtime/pkg/resource"

Expand Down
3 changes: 2 additions & 1 deletion apis/servicenetworking/v1beta1/referencers.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ package v1beta1
import (
"context"

"github.com/pkg/errors"
"sigs.k8s.io/controller-runtime/pkg/client"

"github.com/crossplane/crossplane-runtime/pkg/errors"

"github.com/crossplane/crossplane-runtime/pkg/reference"

"github.com/crossplane/provider-gcp/apis/compute/v1beta1"
Expand Down
5 changes: 3 additions & 2 deletions apis/storage/v1alpha1/referencers.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ package v1alpha1
import (
"context"

"github.com/crossplane/crossplane-runtime/pkg/reference"
"github.com/pkg/errors"
"sigs.k8s.io/controller-runtime/pkg/client"

"github.com/crossplane/crossplane-runtime/pkg/errors"
"github.com/crossplane/crossplane-runtime/pkg/reference"

iamv1alpha1 "github.com/crossplane/provider-gcp/apis/iam/v1alpha1"
"github.com/crossplane/provider-gcp/apis/storage/v1alpha3"
)
Expand Down
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ require (
github.com/google/go-cmp v0.5.6
github.com/imdario/mergo v0.3.12
github.com/mitchellh/copystructure v1.0.0
github.com/pkg/errors v0.9.1
google.golang.org/api v0.52.0
google.golang.org/grpc v1.39.0
gopkg.in/alecthomas/kingpin.v2 v2.2.6
Expand Down
3 changes: 2 additions & 1 deletion pkg/clients/bucketpolicy/bucketpolicy.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ import (
"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
"github.com/mitchellh/copystructure"
"github.com/pkg/errors"
"google.golang.org/api/storage/v1"

"github.com/crossplane/crossplane-runtime/pkg/errors"

iamv1alpha1 "github.com/crossplane/provider-gcp/apis/iam/v1alpha1"
"github.com/crossplane/provider-gcp/apis/storage/v1alpha1"
gcp "github.com/crossplane/provider-gcp/pkg/clients"
Expand Down
3 changes: 2 additions & 1 deletion pkg/clients/cloudmemorystore/cloudmemorystore.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ import (

"github.com/google/go-cmp/cmp"
"github.com/mitchellh/copystructure"
"github.com/pkg/errors"
redis "google.golang.org/api/redis/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

"github.com/crossplane/crossplane-runtime/pkg/errors"

"github.com/crossplane/provider-gcp/apis/cache/v1beta1"
gcp "github.com/crossplane/provider-gcp/pkg/clients"
)
Expand Down
3 changes: 1 addition & 2 deletions pkg/clients/cloudsql/cloudsql.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ package cloudsql
import (
"strings"

"github.com/pkg/errors"

"github.com/crossplane/crossplane-runtime/pkg/errors"
"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
"github.com/mitchellh/copystructure"
Expand Down
3 changes: 2 additions & 1 deletion pkg/clients/cluster/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@ import (
"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
"github.com/mitchellh/copystructure"
"github.com/pkg/errors"
container "google.golang.org/api/container/v1"
clientcmdapi "k8s.io/client-go/tools/clientcmd/api"

"github.com/crossplane/crossplane-runtime/pkg/errors"

"github.com/crossplane/provider-gcp/apis/container/v1beta2"
gcp "github.com/crossplane/provider-gcp/pkg/clients"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/clients/cluster/cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ import (
"testing"

"github.com/google/go-cmp/cmp"
"github.com/pkg/errors"
container "google.golang.org/api/container/v1"
clientcmdapi "k8s.io/client-go/tools/clientcmd/api"

"github.com/crossplane/crossplane-runtime/pkg/errors"
"github.com/crossplane/crossplane-runtime/pkg/test"

"github.com/crossplane/provider-gcp/apis/container/v1beta2"
Expand Down
3 changes: 2 additions & 1 deletion pkg/clients/cryptokey/cryptokey.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ import (
"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
"github.com/mitchellh/copystructure"
"github.com/pkg/errors"
"google.golang.org/api/cloudkms/v1"

"github.com/crossplane/crossplane-runtime/pkg/errors"

"github.com/crossplane/provider-gcp/apis/kms/v1alpha1"
gcp "github.com/crossplane/provider-gcp/pkg/clients"
)
Expand Down
3 changes: 2 additions & 1 deletion pkg/clients/cryptokeypolicy/cryptokeypolicy.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ import (
"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
"github.com/mitchellh/copystructure"
"github.com/pkg/errors"
"google.golang.org/api/cloudkms/v1"

"github.com/crossplane/crossplane-runtime/pkg/errors"

iamv1alpha1 "github.com/crossplane/provider-gcp/apis/iam/v1alpha1"
"github.com/crossplane/provider-gcp/apis/kms/v1alpha1"
gcp "github.com/crossplane/provider-gcp/pkg/clients"
Expand Down
7 changes: 4 additions & 3 deletions pkg/clients/dns/resource_record_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,16 @@ package dns
import (
"context"

"github.com/crossplane/crossplane-runtime/pkg/meta"
"github.com/crossplane/crossplane-runtime/pkg/resource"
"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
"github.com/mitchellh/copystructure"
"github.com/pkg/errors"
dns "google.golang.org/api/dns/v1"
"sigs.k8s.io/controller-runtime/pkg/client"

"github.com/crossplane/crossplane-runtime/pkg/errors"
"github.com/crossplane/crossplane-runtime/pkg/meta"
"github.com/crossplane/crossplane-runtime/pkg/resource"

"github.com/crossplane/provider-gcp/apis/dns/v1alpha1"
)

Expand Down
7 changes: 4 additions & 3 deletions pkg/clients/dns/resource_record_set_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@ import (
"context"
"testing"

"github.com/crossplane/crossplane-runtime/pkg/meta"
"github.com/crossplane/crossplane-runtime/pkg/resource"
"github.com/crossplane/crossplane-runtime/pkg/test"
"github.com/google/go-cmp/cmp"
"google.golang.org/api/dns/v1"
"sigs.k8s.io/controller-runtime/pkg/client"

"github.com/crossplane/crossplane-runtime/pkg/meta"
"github.com/crossplane/crossplane-runtime/pkg/resource"
"github.com/crossplane/crossplane-runtime/pkg/test"

"github.com/crossplane/provider-gcp/apis/dns/v1alpha1"
)

Expand Down
3 changes: 2 additions & 1 deletion pkg/clients/firewall/firewall.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ import (
"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
"github.com/mitchellh/copystructure"
"github.com/pkg/errors"
compute "google.golang.org/api/compute/v1"

"github.com/crossplane/crossplane-runtime/pkg/errors"

"github.com/crossplane/provider-gcp/apis/compute/v1alpha1"
gcp "github.com/crossplane/provider-gcp/pkg/clients"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/clients/gcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import (
"strings"

"github.com/google/go-cmp/cmp"
"github.com/pkg/errors"
"google.golang.org/api/googleapi"
"google.golang.org/api/option"
"google.golang.org/grpc/codes"
Expand All @@ -32,6 +31,7 @@ import (
"k8s.io/apimachinery/pkg/types"
"sigs.k8s.io/controller-runtime/pkg/client"

"github.com/crossplane/crossplane-runtime/pkg/errors"
"github.com/crossplane/crossplane-runtime/pkg/resource"

cmpv1beta1 "github.com/crossplane/provider-gcp/apis/compute/v1beta1"
Expand Down
3 changes: 2 additions & 1 deletion pkg/clients/network/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ import (
"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
"github.com/mitchellh/copystructure"
"github.com/pkg/errors"
compute "google.golang.org/api/compute/v1"

"github.com/crossplane/crossplane-runtime/pkg/errors"

"github.com/crossplane/provider-gcp/apis/compute/v1beta1"
gcp "github.com/crossplane/provider-gcp/pkg/clients"
)
Expand Down
3 changes: 2 additions & 1 deletion pkg/clients/nodepool/nodepool.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ import (
"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
"github.com/mitchellh/copystructure"
"github.com/pkg/errors"
container "google.golang.org/api/container/v1"

"github.com/crossplane/crossplane-runtime/pkg/errors"

"github.com/crossplane/provider-gcp/apis/container/v1beta1"
"github.com/crossplane/provider-gcp/apis/container/v1beta2"
gcp "github.com/crossplane/provider-gcp/pkg/clients"
Expand Down
3 changes: 2 additions & 1 deletion pkg/clients/serviceaccountpolicy/serviceaccountpolicy.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ import (
"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
"github.com/mitchellh/copystructure"
"github.com/pkg/errors"
"google.golang.org/api/iam/v1"

"github.com/crossplane/crossplane-runtime/pkg/errors"

"github.com/crossplane/provider-gcp/apis/iam/v1alpha1"
iamv1alpha1 "github.com/crossplane/provider-gcp/apis/iam/v1alpha1"
gcp "github.com/crossplane/provider-gcp/pkg/clients"
Expand Down
3 changes: 2 additions & 1 deletion pkg/clients/subnetwork/subnetwork.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ import (
"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
"github.com/mitchellh/copystructure"
"github.com/pkg/errors"
"google.golang.org/api/compute/v1"

"github.com/crossplane/crossplane-runtime/pkg/errors"

"github.com/crossplane/provider-gcp/apis/compute/v1beta1"
gcp "github.com/crossplane/provider-gcp/pkg/clients"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/cache/managed.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ import (
"time"

"github.com/google/go-cmp/cmp"
"github.com/pkg/errors"
redis "google.golang.org/api/redis/v1"
"k8s.io/client-go/util/workqueue"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/controller"

xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1"
"github.com/crossplane/crossplane-runtime/pkg/errors"
"github.com/crossplane/crossplane-runtime/pkg/event"
"github.com/crossplane/crossplane-runtime/pkg/logging"
"github.com/crossplane/crossplane-runtime/pkg/meta"
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/cache/managed_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ import (
"testing"

"github.com/google/go-cmp/cmp"
"github.com/pkg/errors"
"google.golang.org/api/googleapi"
"google.golang.org/api/option"
redis "google.golang.org/api/redis/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/controller-runtime/pkg/client"

xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1"
"github.com/crossplane/crossplane-runtime/pkg/errors"
"github.com/crossplane/crossplane-runtime/pkg/meta"
"github.com/crossplane/crossplane-runtime/pkg/reconciler/managed"
"github.com/crossplane/crossplane-runtime/pkg/resource"
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/compute/firewall.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ import (
"time"

"github.com/google/go-cmp/cmp"
"github.com/pkg/errors"
"google.golang.org/api/compute/v1"
"k8s.io/client-go/util/workqueue"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/controller"

xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1"
"github.com/crossplane/crossplane-runtime/pkg/errors"
"github.com/crossplane/crossplane-runtime/pkg/event"
"github.com/crossplane/crossplane-runtime/pkg/logging"
"github.com/crossplane/crossplane-runtime/pkg/meta"
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/compute/firewall_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ import (
"testing"

"github.com/google/go-cmp/cmp"
"github.com/pkg/errors"
compute "google.golang.org/api/compute/v1"
"google.golang.org/api/option"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/controller-runtime/pkg/client"

xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1"
"github.com/crossplane/crossplane-runtime/pkg/errors"
"github.com/crossplane/crossplane-runtime/pkg/meta"
"github.com/crossplane/crossplane-runtime/pkg/reconciler/managed"
"github.com/crossplane/crossplane-runtime/pkg/resource"
Expand Down
Loading

0 comments on commit f5b8818

Please sign in to comment.