diff --git a/.golangci.yml b/.golangci.yml index a6cc3f56..fb24e160 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -44,8 +44,7 @@ linters-settings: sections: - standard - default - - prefix(github.com/crossplane/crossplane-runtime) - - prefix(github.com/crossplane/crossplane) + - prefix(github.com/crossplane/upjet) - blank - dot diff --git a/cmd/scraper/main.go b/cmd/scraper/main.go index 077c3170..692697e1 100644 --- a/cmd/scraper/main.go +++ b/cmd/scraper/main.go @@ -8,8 +8,9 @@ import ( "os" "path/filepath" - "github.com/crossplane/upjet/pkg/registry" "gopkg.in/alecthomas/kingpin.v2" + + "github.com/crossplane/upjet/pkg/registry" ) func main() { diff --git a/pkg/config/common.go b/pkg/config/common.go index 7bf2226a..ee291e39 100644 --- a/pkg/config/common.go +++ b/pkg/config/common.go @@ -7,9 +7,10 @@ package config import ( "strings" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/crossplane/upjet/pkg/registry" tjname "github.com/crossplane/upjet/pkg/types/name" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) const ( diff --git a/pkg/config/externalname_test.go b/pkg/config/externalname_test.go index c9f39b2a..f090a0f6 100644 --- a/pkg/config/externalname_test.go +++ b/pkg/config/externalname_test.go @@ -8,10 +8,9 @@ import ( "context" "testing" - "github.com/google/go-cmp/cmp" - "github.com/crossplane/crossplane-runtime/pkg/errors" "github.com/crossplane/crossplane-runtime/pkg/test" + "github.com/google/go-cmp/cmp" ) func TestGetExternalNameFromTemplated(t *testing.T) { diff --git a/pkg/config/resource.go b/pkg/config/resource.go index 14b31ac2..7e106af8 100644 --- a/pkg/config/resource.go +++ b/pkg/config/resource.go @@ -9,6 +9,10 @@ import ( "fmt" "time" + xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + "github.com/crossplane/crossplane-runtime/pkg/fieldpath" + "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" + xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" "github.com/pkg/errors" @@ -17,11 +21,6 @@ import ( "k8s.io/utils/ptr" "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" - "github.com/crossplane/crossplane-runtime/pkg/fieldpath" - "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" - xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" - "github.com/crossplane/upjet/pkg/registry" ) diff --git a/pkg/config/resource_test.go b/pkg/config/resource_test.go index 4663781b..a94366c7 100644 --- a/pkg/config/resource_test.go +++ b/pkg/config/resource_test.go @@ -9,14 +9,13 @@ import ( "fmt" "testing" - "github.com/google/go-cmp/cmp" - "sigs.k8s.io/controller-runtime/pkg/client" - "github.com/crossplane/crossplane-runtime/pkg/errors" "github.com/crossplane/crossplane-runtime/pkg/fieldpath" xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" "github.com/crossplane/crossplane-runtime/pkg/resource/fake" "github.com/crossplane/crossplane-runtime/pkg/test" + "github.com/google/go-cmp/cmp" + "sigs.k8s.io/controller-runtime/pkg/client" ) const ( diff --git a/pkg/controller/api.go b/pkg/controller/api.go index 9a5808c5..f8efda9b 100644 --- a/pkg/controller/api.go +++ b/pkg/controller/api.go @@ -7,9 +7,8 @@ package controller import ( "context" - "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/resource" - "github.com/crossplane/upjet/pkg/terraform" + xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" "github.com/pkg/errors" v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/runtime/schema" @@ -17,8 +16,9 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" ctrl "sigs.k8s.io/controller-runtime/pkg/manager" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" - xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/crossplane/upjet/pkg/controller/handler" + "github.com/crossplane/upjet/pkg/resource" + "github.com/crossplane/upjet/pkg/terraform" ) const ( diff --git a/pkg/controller/api_test.go b/pkg/controller/api_test.go index b42e662c..7bd60b3c 100644 --- a/pkg/controller/api_test.go +++ b/pkg/controller/api_test.go @@ -8,17 +8,17 @@ import ( "context" "testing" - "github.com/crossplane/upjet/pkg/resource" - "github.com/crossplane/upjet/pkg/resource/fake" - tjerrors "github.com/crossplane/upjet/pkg/terraform/errors" + xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + xpfake "github.com/crossplane/crossplane-runtime/pkg/resource/fake" + "github.com/crossplane/crossplane-runtime/pkg/test" "github.com/google/go-cmp/cmp" "github.com/pkg/errors" "sigs.k8s.io/controller-runtime/pkg/client" ctrl "sigs.k8s.io/controller-runtime/pkg/manager" - xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" - xpfake "github.com/crossplane/crossplane-runtime/pkg/resource/fake" - "github.com/crossplane/crossplane-runtime/pkg/test" + "github.com/crossplane/upjet/pkg/resource" + "github.com/crossplane/upjet/pkg/resource/fake" + tjerrors "github.com/crossplane/upjet/pkg/terraform/errors" ) func TestAPICallbacksCreate(t *testing.T) { diff --git a/pkg/controller/external.go b/pkg/controller/external.go index 62580935..4eff3812 100644 --- a/pkg/controller/external.go +++ b/pkg/controller/external.go @@ -8,6 +8,14 @@ import ( "context" "time" + xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + "github.com/crossplane/crossplane-runtime/pkg/logging" + "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" + xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/pkg/errors" + "k8s.io/apimachinery/pkg/util/sets" + "sigs.k8s.io/controller-runtime/pkg/client" + "github.com/crossplane/upjet/pkg/config" "github.com/crossplane/upjet/pkg/controller/handler" "github.com/crossplane/upjet/pkg/metrics" @@ -15,14 +23,6 @@ import ( "github.com/crossplane/upjet/pkg/resource/json" "github.com/crossplane/upjet/pkg/terraform" tferrors "github.com/crossplane/upjet/pkg/terraform/errors" - "github.com/pkg/errors" - "k8s.io/apimachinery/pkg/util/sets" - "sigs.k8s.io/controller-runtime/pkg/client" - - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" - "github.com/crossplane/crossplane-runtime/pkg/logging" - "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" - xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" ) const ( diff --git a/pkg/controller/external_test.go b/pkg/controller/external_test.go index 7710e705..68e06c16 100644 --- a/pkg/controller/external_test.go +++ b/pkg/controller/external_test.go @@ -8,17 +8,6 @@ import ( "context" "testing" - "github.com/crossplane/upjet/pkg/config" - "github.com/crossplane/upjet/pkg/resource" - "github.com/crossplane/upjet/pkg/resource/fake" - "github.com/crossplane/upjet/pkg/resource/json" - "github.com/crossplane/upjet/pkg/terraform" - "github.com/google/go-cmp/cmp" - "github.com/google/go-cmp/cmp/cmpopts" - "github.com/pkg/errors" - 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/logging" xpmeta "github.com/crossplane/crossplane-runtime/pkg/meta" @@ -26,6 +15,17 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" xpfake "github.com/crossplane/crossplane-runtime/pkg/resource/fake" "github.com/crossplane/crossplane-runtime/pkg/test" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "github.com/pkg/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "sigs.k8s.io/controller-runtime/pkg/client" + + "github.com/crossplane/upjet/pkg/config" + "github.com/crossplane/upjet/pkg/resource" + "github.com/crossplane/upjet/pkg/resource/fake" + "github.com/crossplane/upjet/pkg/resource/json" + "github.com/crossplane/upjet/pkg/terraform" ) const ( diff --git a/pkg/controller/handler/eventhandler.go b/pkg/controller/handler/eventhandler.go index 7d0c31f9..7032e3ca 100644 --- a/pkg/controller/handler/eventhandler.go +++ b/pkg/controller/handler/eventhandler.go @@ -9,13 +9,12 @@ import ( "sync" "time" + "github.com/crossplane/crossplane-runtime/pkg/logging" "k8s.io/apimachinery/pkg/types" "k8s.io/client-go/util/workqueue" "sigs.k8s.io/controller-runtime/pkg/event" "sigs.k8s.io/controller-runtime/pkg/handler" "sigs.k8s.io/controller-runtime/pkg/reconcile" - - "github.com/crossplane/crossplane-runtime/pkg/logging" ) const NoRateLimiter = "" diff --git a/pkg/controller/options.go b/pkg/controller/options.go index 491e12e2..353ef866 100644 --- a/pkg/controller/options.go +++ b/pkg/controller/options.go @@ -8,11 +8,11 @@ import ( "crypto/tls" "time" - "github.com/crossplane/upjet/pkg/config" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/crossplane-runtime/pkg/controller" "k8s.io/apimachinery/pkg/runtime/schema" - "github.com/crossplane/crossplane-runtime/pkg/controller" + "github.com/crossplane/upjet/pkg/config" + "github.com/crossplane/upjet/pkg/terraform" ) // Options contains incriminating options for a given Upjet controller instance. diff --git a/pkg/migration/api_steps.go b/pkg/migration/api_steps.go index f077fc89..de1082cd 100644 --- a/pkg/migration/api_steps.go +++ b/pkg/migration/api_steps.go @@ -8,14 +8,13 @@ import ( "fmt" "strconv" - "github.com/pkg/errors" - corev1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/resource/unstructured/claim" "github.com/crossplane/crossplane-runtime/pkg/resource/unstructured/composite" + "github.com/pkg/errors" + corev1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" ) const ( diff --git a/pkg/migration/configurationmetadata_steps.go b/pkg/migration/configurationmetadata_steps.go index ea18ff33..a28ad611 100644 --- a/pkg/migration/configurationmetadata_steps.go +++ b/pkg/migration/configurationmetadata_steps.go @@ -8,10 +8,9 @@ import ( "fmt" "strconv" - "github.com/pkg/errors" - xpmetav1 "github.com/crossplane/crossplane/apis/pkg/meta/v1" xpmetav1alpha1 "github.com/crossplane/crossplane/apis/pkg/meta/v1alpha1" + "github.com/pkg/errors" ) const ( diff --git a/pkg/migration/configurationpackage_steps.go b/pkg/migration/configurationpackage_steps.go index d8103eaa..dbabd470 100644 --- a/pkg/migration/configurationpackage_steps.go +++ b/pkg/migration/configurationpackage_steps.go @@ -7,11 +7,10 @@ package migration import ( "fmt" - "github.com/pkg/errors" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/fieldpath" + "github.com/pkg/errors" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" ) const ( diff --git a/pkg/migration/converter.go b/pkg/migration/converter.go index b6cbe41f..d137e21f 100644 --- a/pkg/migration/converter.go +++ b/pkg/migration/converter.go @@ -7,24 +7,22 @@ package migration import ( "fmt" - "github.com/pkg/errors" - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/util/json" - k8sjson "sigs.k8s.io/json" - "github.com/crossplane/crossplane-runtime/pkg/fieldpath" xpmeta "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/resource" - xpv1 "github.com/crossplane/crossplane/apis/apiextensions/v1" xpmetav1 "github.com/crossplane/crossplane/apis/pkg/meta/v1" xpmetav1alpha1 "github.com/crossplane/crossplane/apis/pkg/meta/v1alpha1" xppkgv1 "github.com/crossplane/crossplane/apis/pkg/v1" xppkgv1beta1 "github.com/crossplane/crossplane/apis/pkg/v1beta1" + "github.com/pkg/errors" + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apimachinery/pkg/util/json" + k8sjson "sigs.k8s.io/json" ) const ( diff --git a/pkg/migration/fake/objects.go b/pkg/migration/fake/objects.go index c9b1a59e..81c7e614 100644 --- a/pkg/migration/fake/objects.go +++ b/pkg/migration/fake/objects.go @@ -7,10 +7,10 @@ package fake import ( - "github.com/crossplane/upjet/pkg/migration/fake/mocks" + xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "k8s.io/apimachinery/pkg/runtime/schema" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + "github.com/crossplane/upjet/pkg/migration/fake/mocks" ) const ( diff --git a/pkg/migration/fork_executor.go b/pkg/migration/fork_executor.go index 61e46281..f756f622 100644 --- a/pkg/migration/fork_executor.go +++ b/pkg/migration/fork_executor.go @@ -7,10 +7,9 @@ package migration import ( "os" + "github.com/crossplane/crossplane-runtime/pkg/logging" "github.com/pkg/errors" "k8s.io/utils/exec" - - "github.com/crossplane/crossplane-runtime/pkg/logging" ) const ( diff --git a/pkg/migration/fork_executor_test.go b/pkg/migration/fork_executor_test.go index cc146156..14538ff4 100644 --- a/pkg/migration/fork_executor_test.go +++ b/pkg/migration/fork_executor_test.go @@ -7,12 +7,11 @@ package migration import ( "testing" + "github.com/crossplane/crossplane-runtime/pkg/test" "github.com/google/go-cmp/cmp" "github.com/pkg/errors" k8sExec "k8s.io/utils/exec" testingexec "k8s.io/utils/exec/testing" - - "github.com/crossplane/crossplane-runtime/pkg/test" ) var ( diff --git a/pkg/migration/interfaces.go b/pkg/migration/interfaces.go index a8771588..466b4b05 100644 --- a/pkg/migration/interfaces.go +++ b/pkg/migration/interfaces.go @@ -6,7 +6,6 @@ package migration import ( "github.com/crossplane/crossplane-runtime/pkg/resource" - xpv1 "github.com/crossplane/crossplane/apis/apiextensions/v1" xpmetav1 "github.com/crossplane/crossplane/apis/pkg/meta/v1" xpmetav1alpha1 "github.com/crossplane/crossplane/apis/pkg/meta/v1alpha1" diff --git a/pkg/migration/patches.go b/pkg/migration/patches.go index d5d84188..e09ea770 100644 --- a/pkg/migration/patches.go +++ b/pkg/migration/patches.go @@ -11,11 +11,10 @@ import ( "regexp" "strings" + xpv1 "github.com/crossplane/crossplane/apis/apiextensions/v1" "github.com/pkg/errors" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" - - xpv1 "github.com/crossplane/crossplane/apis/apiextensions/v1" ) var ( diff --git a/pkg/migration/plan_generator.go b/pkg/migration/plan_generator.go index fcd8d4a6..70c73bfa 100644 --- a/pkg/migration/plan_generator.go +++ b/pkg/migration/plan_generator.go @@ -9,20 +9,18 @@ import ( "reflect" "time" - "github.com/pkg/errors" - corev1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/util/rand" - "github.com/crossplane/crossplane-runtime/pkg/fieldpath" "github.com/crossplane/crossplane-runtime/pkg/resource" - xpv1 "github.com/crossplane/crossplane/apis/apiextensions/v1" xpmetav1 "github.com/crossplane/crossplane/apis/pkg/meta/v1" xpmetav1alpha1 "github.com/crossplane/crossplane/apis/pkg/meta/v1alpha1" xppkgv1 "github.com/crossplane/crossplane/apis/pkg/v1" xppkgv1beta1 "github.com/crossplane/crossplane/apis/pkg/v1beta1" + "github.com/pkg/errors" + corev1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apimachinery/pkg/util/rand" ) const ( diff --git a/pkg/migration/plan_generator_test.go b/pkg/migration/plan_generator_test.go index eb16bdff..791d7cbf 100644 --- a/pkg/migration/plan_generator_test.go +++ b/pkg/migration/plan_generator_test.go @@ -11,7 +11,13 @@ import ( "regexp" "testing" - "github.com/crossplane/upjet/pkg/migration/fake" + xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/crossplane/crossplane-runtime/pkg/test" + v1 "github.com/crossplane/crossplane/apis/apiextensions/v1" + xpmetav1 "github.com/crossplane/crossplane/apis/pkg/meta/v1" + xpmetav1alpha1 "github.com/crossplane/crossplane/apis/pkg/meta/v1alpha1" + xppkgv1 "github.com/crossplane/crossplane/apis/pkg/v1" + xppkgv1beta1 "github.com/crossplane/crossplane/apis/pkg/v1beta1" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -21,14 +27,7 @@ import ( "k8s.io/apimachinery/pkg/util/yaml" k8syaml "sigs.k8s.io/yaml" - xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" - "github.com/crossplane/crossplane-runtime/pkg/test" - - v1 "github.com/crossplane/crossplane/apis/apiextensions/v1" - xpmetav1 "github.com/crossplane/crossplane/apis/pkg/meta/v1" - xpmetav1alpha1 "github.com/crossplane/crossplane/apis/pkg/meta/v1alpha1" - xppkgv1 "github.com/crossplane/crossplane/apis/pkg/v1" - xppkgv1beta1 "github.com/crossplane/crossplane/apis/pkg/v1beta1" + "github.com/crossplane/upjet/pkg/migration/fake" ) func TestGeneratePlan(t *testing.T) { diff --git a/pkg/migration/provider_package_steps.go b/pkg/migration/provider_package_steps.go index 5064b086..5e1f160e 100644 --- a/pkg/migration/provider_package_steps.go +++ b/pkg/migration/provider_package_steps.go @@ -8,10 +8,9 @@ import ( "fmt" "strings" + "github.com/crossplane/crossplane-runtime/pkg/fieldpath" "github.com/pkg/errors" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - - "github.com/crossplane/crossplane-runtime/pkg/fieldpath" ) const ( diff --git a/pkg/migration/registry.go b/pkg/migration/registry.go index 617dfd7b..c4970f0f 100644 --- a/pkg/migration/registry.go +++ b/pkg/migration/registry.go @@ -7,17 +7,15 @@ package migration import ( "regexp" - "github.com/pkg/errors" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "github.com/crossplane/crossplane-runtime/pkg/resource" - xpv1 "github.com/crossplane/crossplane/apis/apiextensions/v1" xpmetav1 "github.com/crossplane/crossplane/apis/pkg/meta/v1" xpmetav1alpha1 "github.com/crossplane/crossplane/apis/pkg/meta/v1alpha1" xppkgv1 "github.com/crossplane/crossplane/apis/pkg/v1" xppkgv1beta1 "github.com/crossplane/crossplane/apis/pkg/v1beta1" + "github.com/pkg/errors" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" ) var ( diff --git a/pkg/pipeline/register.go b/pkg/pipeline/register.go index 5cd80fbb..f814547b 100644 --- a/pkg/pipeline/register.go +++ b/pkg/pipeline/register.go @@ -9,9 +9,10 @@ import ( "path/filepath" "sort" - "github.com/crossplane/upjet/pkg/pipeline/templates" "github.com/muvaf/typewriter/pkg/wrapper" "github.com/pkg/errors" + + "github.com/crossplane/upjet/pkg/pipeline/templates" ) // NewRegisterGenerator returns a new RegisterGenerator. diff --git a/pkg/pipeline/run.go b/pkg/pipeline/run.go index 4b1e3353..4d707984 100644 --- a/pkg/pipeline/run.go +++ b/pkg/pipeline/run.go @@ -11,10 +11,10 @@ import ( "sort" "strings" + "github.com/crossplane/crossplane-runtime/pkg/errors" + "github.com/crossplane/upjet/pkg/config" "github.com/crossplane/upjet/pkg/examples" - - "github.com/crossplane/crossplane-runtime/pkg/errors" ) type terraformedInput struct { diff --git a/pkg/pipeline/setup.go b/pkg/pipeline/setup.go index 121f6cba..2b85b276 100644 --- a/pkg/pipeline/setup.go +++ b/pkg/pipeline/setup.go @@ -12,10 +12,11 @@ import ( "sort" "text/template" - "github.com/crossplane/upjet/pkg/config" - "github.com/crossplane/upjet/pkg/pipeline/templates" "github.com/muvaf/typewriter/pkg/wrapper" "github.com/pkg/errors" + + "github.com/crossplane/upjet/pkg/config" + "github.com/crossplane/upjet/pkg/pipeline/templates" ) // NewProviderGenerator returns a new ProviderGenerator. diff --git a/pkg/pipeline/terraformed.go b/pkg/pipeline/terraformed.go index 10796b22..fea56e6a 100644 --- a/pkg/pipeline/terraformed.go +++ b/pkg/pipeline/terraformed.go @@ -10,9 +10,10 @@ import ( "path/filepath" "strings" - "github.com/crossplane/upjet/pkg/pipeline/templates" "github.com/muvaf/typewriter/pkg/wrapper" "github.com/pkg/errors" + + "github.com/crossplane/upjet/pkg/pipeline/templates" ) // NewTerraformedGenerator returns a new TerraformedGenerator. diff --git a/pkg/pipeline/version.go b/pkg/pipeline/version.go index c155a061..d0093b82 100644 --- a/pkg/pipeline/version.go +++ b/pkg/pipeline/version.go @@ -10,9 +10,10 @@ import ( "path/filepath" "strings" - "github.com/crossplane/upjet/pkg/pipeline/templates" "github.com/muvaf/typewriter/pkg/wrapper" "github.com/pkg/errors" + + "github.com/crossplane/upjet/pkg/pipeline/templates" ) // NewVersionGenerator returns a new VersionGenerator. diff --git a/pkg/registry/meta_test.go b/pkg/registry/meta_test.go index 4fb46975..84a6717d 100644 --- a/pkg/registry/meta_test.go +++ b/pkg/registry/meta_test.go @@ -8,12 +8,11 @@ import ( "os" "testing" + "github.com/crossplane/crossplane-runtime/pkg/fieldpath" + xptest "github.com/crossplane/crossplane-runtime/pkg/test" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "gopkg.in/yaml.v3" - - "github.com/crossplane/crossplane-runtime/pkg/fieldpath" - xptest "github.com/crossplane/crossplane-runtime/pkg/test" ) func TestScrapeRepo(t *testing.T) { diff --git a/pkg/registry/reference/references.go b/pkg/registry/reference/references.go index f15b6dec..fc9fcc99 100644 --- a/pkg/registry/reference/references.go +++ b/pkg/registry/reference/references.go @@ -8,10 +8,11 @@ import ( "fmt" "strings" + "github.com/pkg/errors" + "github.com/crossplane/upjet/pkg/config" "github.com/crossplane/upjet/pkg/registry" "github.com/crossplane/upjet/pkg/types" - "github.com/pkg/errors" ) const ( diff --git a/pkg/registry/reference/resolver.go b/pkg/registry/reference/resolver.go index 63941112..6fc6dccf 100644 --- a/pkg/registry/reference/resolver.go +++ b/pkg/registry/reference/resolver.go @@ -10,12 +10,12 @@ import ( "strconv" "strings" + "github.com/crossplane/crossplane-runtime/pkg/fieldpath" + "github.com/pkg/errors" + "github.com/crossplane/upjet/pkg/config" "github.com/crossplane/upjet/pkg/registry" "github.com/crossplane/upjet/pkg/resource/json" - "github.com/pkg/errors" - - "github.com/crossplane/crossplane-runtime/pkg/fieldpath" ) const ( diff --git a/pkg/registry/resource.go b/pkg/registry/resource.go index 53e9f781..e8f949b5 100644 --- a/pkg/registry/resource.go +++ b/pkg/registry/resource.go @@ -5,11 +5,11 @@ package registry import ( - "github.com/crossplane/upjet/pkg/resource/json" + "github.com/crossplane/crossplane-runtime/pkg/fieldpath" "github.com/pkg/errors" "gopkg.in/yaml.v2" - "github.com/crossplane/crossplane-runtime/pkg/fieldpath" + "github.com/crossplane/upjet/pkg/resource/json" ) const ( diff --git a/pkg/resource/conditions.go b/pkg/resource/conditions.go index 62e8462b..05a5877c 100644 --- a/pkg/resource/conditions.go +++ b/pkg/resource/conditions.go @@ -5,12 +5,12 @@ package resource import ( - tferrors "github.com/crossplane/upjet/pkg/terraform/errors" + xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" - xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + tferrors "github.com/crossplane/upjet/pkg/terraform/errors" ) // Condition constants. diff --git a/pkg/resource/fake/terraformed.go b/pkg/resource/fake/terraformed.go index 6c97732e..ed71b356 100644 --- a/pkg/resource/fake/terraformed.go +++ b/pkg/resource/fake/terraformed.go @@ -5,11 +5,10 @@ package fake import ( + "github.com/crossplane/crossplane-runtime/pkg/resource/fake" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/util/json" - - "github.com/crossplane/crossplane-runtime/pkg/resource/fake" ) // Observable is mock Observable. diff --git a/pkg/resource/lateinit.go b/pkg/resource/lateinit.go index 9d9ffa9a..6d592306 100644 --- a/pkg/resource/lateinit.go +++ b/pkg/resource/lateinit.go @@ -10,12 +10,12 @@ import ( "runtime/debug" "strings" - "github.com/crossplane/upjet/pkg/config" + xpmeta "github.com/crossplane/crossplane-runtime/pkg/meta" + xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" "github.com/pkg/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - xpmeta "github.com/crossplane/crossplane-runtime/pkg/meta" - xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/crossplane/upjet/pkg/config" ) const ( diff --git a/pkg/resource/sensitive.go b/pkg/resource/sensitive.go index 70b21454..229ddd97 100644 --- a/pkg/resource/sensitive.go +++ b/pkg/resource/sensitive.go @@ -10,15 +10,15 @@ import ( "regexp" "strings" - "github.com/crossplane/upjet/pkg/config" - "github.com/pkg/errors" - kerrors "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/runtime" - v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/fieldpath" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/pkg/errors" + kerrors "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/runtime" + + "github.com/crossplane/upjet/pkg/config" ) const ( diff --git a/pkg/resource/sensitive_test.go b/pkg/resource/sensitive_test.go index 4aa71919..de2aabc8 100644 --- a/pkg/resource/sensitive_test.go +++ b/pkg/resource/sensitive_test.go @@ -8,10 +8,9 @@ import ( "context" "testing" - "github.com/crossplane/upjet/pkg/config" - "github.com/crossplane/upjet/pkg/resource/fake" - "github.com/crossplane/upjet/pkg/resource/fake/mocks" - "github.com/crossplane/upjet/pkg/resource/json" + xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" + "github.com/crossplane/crossplane-runtime/pkg/test" "github.com/golang/mock/gomock" "github.com/google/go-cmp/cmp" "github.com/pkg/errors" @@ -20,9 +19,10 @@ import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" - "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" - "github.com/crossplane/crossplane-runtime/pkg/test" + "github.com/crossplane/upjet/pkg/config" + "github.com/crossplane/upjet/pkg/resource/fake" + "github.com/crossplane/upjet/pkg/resource/fake/mocks" + "github.com/crossplane/upjet/pkg/resource/json" ) var ( diff --git a/pkg/terraform/files.go b/pkg/terraform/files.go index 404488aa..78adac16 100644 --- a/pkg/terraform/files.go +++ b/pkg/terraform/files.go @@ -12,15 +12,14 @@ import ( "strings" "dario.cat/mergo" + "github.com/crossplane/crossplane-runtime/pkg/feature" + "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/pkg/errors" "github.com/spf13/afero" "github.com/crossplane/upjet/pkg/config" "github.com/crossplane/upjet/pkg/resource" "github.com/crossplane/upjet/pkg/resource/json" - - "github.com/crossplane/crossplane-runtime/pkg/feature" - "github.com/crossplane/crossplane-runtime/pkg/meta" ) const ( diff --git a/pkg/terraform/files_test.go b/pkg/terraform/files_test.go index 975b687d..926ac1f2 100644 --- a/pkg/terraform/files_test.go +++ b/pkg/terraform/files_test.go @@ -11,19 +11,19 @@ import ( "testing" "time" - "github.com/crossplane/upjet/pkg/config" - "github.com/crossplane/upjet/pkg/resource" - "github.com/crossplane/upjet/pkg/resource/fake" - "github.com/crossplane/upjet/pkg/resource/json" + "github.com/crossplane/crossplane-runtime/pkg/feature" + "github.com/crossplane/crossplane-runtime/pkg/meta" + xpfake "github.com/crossplane/crossplane-runtime/pkg/resource/fake" + "github.com/crossplane/crossplane-runtime/pkg/test" "github.com/google/go-cmp/cmp" "github.com/pkg/errors" "github.com/spf13/afero" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "github.com/crossplane/crossplane-runtime/pkg/feature" - "github.com/crossplane/crossplane-runtime/pkg/meta" - xpfake "github.com/crossplane/crossplane-runtime/pkg/resource/fake" - "github.com/crossplane/crossplane-runtime/pkg/test" + "github.com/crossplane/upjet/pkg/config" + "github.com/crossplane/upjet/pkg/resource" + "github.com/crossplane/upjet/pkg/resource/fake" + "github.com/crossplane/upjet/pkg/resource/json" ) const ( diff --git a/pkg/terraform/finalizer.go b/pkg/terraform/finalizer.go index bff2607e..cf0043f1 100644 --- a/pkg/terraform/finalizer.go +++ b/pkg/terraform/finalizer.go @@ -7,9 +7,8 @@ package terraform import ( "context" - "github.com/pkg/errors" - xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/pkg/errors" ) const ( diff --git a/pkg/terraform/finalizer_test.go b/pkg/terraform/finalizer_test.go index f2be6d11..1803950a 100644 --- a/pkg/terraform/finalizer_test.go +++ b/pkg/terraform/finalizer_test.go @@ -8,13 +8,13 @@ import ( "context" "testing" - "github.com/crossplane/upjet/pkg/resource" - "github.com/google/go-cmp/cmp" - "github.com/pkg/errors" - "github.com/crossplane/crossplane-runtime/pkg/logging" xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" "github.com/crossplane/crossplane-runtime/pkg/test" + "github.com/google/go-cmp/cmp" + "github.com/pkg/errors" + + "github.com/crossplane/upjet/pkg/resource" ) var ( diff --git a/pkg/terraform/provider_runner.go b/pkg/terraform/provider_runner.go index 6653995e..e9753fca 100644 --- a/pkg/terraform/provider_runner.go +++ b/pkg/terraform/provider_runner.go @@ -12,11 +12,10 @@ import ( "sync" "time" + "github.com/crossplane/crossplane-runtime/pkg/logging" "github.com/pkg/errors" "k8s.io/utils/clock" "k8s.io/utils/exec" - - "github.com/crossplane/crossplane-runtime/pkg/logging" ) const ( diff --git a/pkg/terraform/provider_runner_test.go b/pkg/terraform/provider_runner_test.go index bd558110..fd584c4d 100644 --- a/pkg/terraform/provider_runner_test.go +++ b/pkg/terraform/provider_runner_test.go @@ -14,14 +14,13 @@ import ( "testing" "time" + "github.com/crossplane/crossplane-runtime/pkg/logging" + "github.com/crossplane/crossplane-runtime/pkg/test" "github.com/google/go-cmp/cmp" "github.com/pkg/errors" clock "k8s.io/utils/clock/testing" "k8s.io/utils/exec" testingexec "k8s.io/utils/exec/testing" - - "github.com/crossplane/crossplane-runtime/pkg/logging" - "github.com/crossplane/crossplane-runtime/pkg/test" ) func TestStartSharedServer(t *testing.T) { diff --git a/pkg/terraform/provider_scheduler.go b/pkg/terraform/provider_scheduler.go index 60abc288..38240f9e 100644 --- a/pkg/terraform/provider_scheduler.go +++ b/pkg/terraform/provider_scheduler.go @@ -7,10 +7,10 @@ package terraform import ( "sync" - tferrors "github.com/crossplane/upjet/pkg/terraform/errors" + "github.com/crossplane/crossplane-runtime/pkg/logging" "github.com/pkg/errors" - "github.com/crossplane/crossplane-runtime/pkg/logging" + tferrors "github.com/crossplane/upjet/pkg/terraform/errors" ) // ProviderHandle represents native plugin (Terraform provider) process diff --git a/pkg/terraform/store.go b/pkg/terraform/store.go index 2e65ad06..862dab7c 100644 --- a/pkg/terraform/store.go +++ b/pkg/terraform/store.go @@ -15,9 +15,10 @@ import ( "sync" "time" - "github.com/crossplane/upjet/pkg/config" - "github.com/crossplane/upjet/pkg/metrics" - "github.com/crossplane/upjet/pkg/resource" + "github.com/crossplane/crossplane-runtime/pkg/feature" + "github.com/crossplane/crossplane-runtime/pkg/logging" + "github.com/crossplane/crossplane-runtime/pkg/meta" + xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" "github.com/mitchellh/go-ps" "github.com/pkg/errors" "github.com/spf13/afero" @@ -25,10 +26,9 @@ import ( "k8s.io/utils/exec" "sigs.k8s.io/controller-runtime/pkg/client" - "github.com/crossplane/crossplane-runtime/pkg/feature" - "github.com/crossplane/crossplane-runtime/pkg/logging" - "github.com/crossplane/crossplane-runtime/pkg/meta" - xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/crossplane/upjet/pkg/config" + "github.com/crossplane/upjet/pkg/metrics" + "github.com/crossplane/upjet/pkg/resource" ) const ( diff --git a/pkg/terraform/timeouts.go b/pkg/terraform/timeouts.go index 93c3d240..c3defebd 100644 --- a/pkg/terraform/timeouts.go +++ b/pkg/terraform/timeouts.go @@ -5,10 +5,10 @@ package terraform import ( + "github.com/crossplane/crossplane-runtime/pkg/errors" + "github.com/crossplane/upjet/pkg/config" "github.com/crossplane/upjet/pkg/resource/json" - - "github.com/crossplane/crossplane-runtime/pkg/errors" ) // "e2bfb730-ecaa-11e6-8f88-34363bc7c4c0" is a hardcoded string for Terraform diff --git a/pkg/terraform/timeouts_test.go b/pkg/terraform/timeouts_test.go index cc70cd72..3da97f9f 100644 --- a/pkg/terraform/timeouts_test.go +++ b/pkg/terraform/timeouts_test.go @@ -8,10 +8,9 @@ import ( "testing" "time" - "github.com/google/go-cmp/cmp" - "github.com/crossplane/crossplane-runtime/pkg/errors" "github.com/crossplane/crossplane-runtime/pkg/test" + "github.com/google/go-cmp/cmp" ) func TestTimeoutsAsParameter(t *testing.T) { diff --git a/pkg/terraform/workspace.go b/pkg/terraform/workspace.go index beb6d2da..63b39d51 100644 --- a/pkg/terraform/workspace.go +++ b/pkg/terraform/workspace.go @@ -13,15 +13,15 @@ import ( "sync" "time" - "github.com/crossplane/upjet/pkg/metrics" - "github.com/crossplane/upjet/pkg/resource" - "github.com/crossplane/upjet/pkg/resource/json" - tferrors "github.com/crossplane/upjet/pkg/terraform/errors" + "github.com/crossplane/crossplane-runtime/pkg/logging" "github.com/pkg/errors" "github.com/spf13/afero" k8sExec "k8s.io/utils/exec" - "github.com/crossplane/crossplane-runtime/pkg/logging" + "github.com/crossplane/upjet/pkg/metrics" + "github.com/crossplane/upjet/pkg/resource" + "github.com/crossplane/upjet/pkg/resource/json" + tferrors "github.com/crossplane/upjet/pkg/terraform/errors" ) const ( diff --git a/pkg/terraform/workspace_test.go b/pkg/terraform/workspace_test.go index b33c88ee..b0efaeed 100644 --- a/pkg/terraform/workspace_test.go +++ b/pkg/terraform/workspace_test.go @@ -9,15 +9,15 @@ import ( "testing" "time" - "github.com/crossplane/upjet/pkg/resource/json" - tferrors "github.com/crossplane/upjet/pkg/terraform/errors" + "github.com/crossplane/crossplane-runtime/pkg/test" "github.com/google/go-cmp/cmp" "github.com/pkg/errors" "github.com/spf13/afero" k8sExec "k8s.io/utils/exec" testingexec "k8s.io/utils/exec/testing" - "github.com/crossplane/crossplane-runtime/pkg/test" + "github.com/crossplane/upjet/pkg/resource/json" + tferrors "github.com/crossplane/upjet/pkg/terraform/errors" ) var ( diff --git a/pkg/types/builder.go b/pkg/types/builder.go index cae32821..b4dbc3ef 100644 --- a/pkg/types/builder.go +++ b/pkg/types/builder.go @@ -11,13 +11,13 @@ import ( "sort" "strings" - "github.com/crossplane/upjet/pkg/config" + "github.com/crossplane/crossplane-runtime/pkg/fieldpath" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" twtypes "github.com/muvaf/typewriter/pkg/types" "github.com/pkg/errors" "k8s.io/utils/ptr" - "github.com/crossplane/crossplane-runtime/pkg/fieldpath" + "github.com/crossplane/upjet/pkg/config" ) const ( diff --git a/pkg/types/builder_test.go b/pkg/types/builder_test.go index 86fba91e..0322f2e9 100644 --- a/pkg/types/builder_test.go +++ b/pkg/types/builder_test.go @@ -10,12 +10,12 @@ import ( "go/types" "testing" - "github.com/crossplane/upjet/pkg/config" + "github.com/crossplane/crossplane-runtime/pkg/test" "github.com/google/go-cmp/cmp" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/pkg/errors" - "github.com/crossplane/crossplane-runtime/pkg/test" + "github.com/crossplane/upjet/pkg/config" ) func TestBuilder_generateTypeName(t *testing.T) { diff --git a/pkg/types/comments/comment_test.go b/pkg/types/comments/comment_test.go index 8050d203..8f561d1b 100644 --- a/pkg/types/comments/comment_test.go +++ b/pkg/types/comments/comment_test.go @@ -8,12 +8,12 @@ import ( "reflect" "testing" - "github.com/crossplane/upjet/pkg/config" - "github.com/crossplane/upjet/pkg/types/markers" + "github.com/crossplane/crossplane-runtime/pkg/test" "github.com/google/go-cmp/cmp" "github.com/pkg/errors" - "github.com/crossplane/crossplane-runtime/pkg/test" + "github.com/crossplane/upjet/pkg/config" + "github.com/crossplane/upjet/pkg/types/markers" ) func TestComment_Build(t *testing.T) { diff --git a/pkg/types/markers/crossplane_test.go b/pkg/types/markers/crossplane_test.go index 58269280..dbf4e1c6 100644 --- a/pkg/types/markers/crossplane_test.go +++ b/pkg/types/markers/crossplane_test.go @@ -7,8 +7,9 @@ package markers import ( "testing" - "github.com/crossplane/upjet/pkg/config" "github.com/google/go-cmp/cmp" + + "github.com/crossplane/upjet/pkg/config" ) func TestCrossplaneOptions_String(t *testing.T) { diff --git a/pkg/types/markers/terrajet_test.go b/pkg/types/markers/terrajet_test.go index 88d526e5..e196a4af 100644 --- a/pkg/types/markers/terrajet_test.go +++ b/pkg/types/markers/terrajet_test.go @@ -8,10 +8,9 @@ import ( "fmt" "testing" + "github.com/crossplane/crossplane-runtime/pkg/test" "github.com/google/go-cmp/cmp" "github.com/pkg/errors" - - "github.com/crossplane/crossplane-runtime/pkg/test" ) func Test_parseAsUpjetOption(t *testing.T) { diff --git a/pkg/types/reference.go b/pkg/types/reference.go index 9fcf78f2..72c14c5c 100644 --- a/pkg/types/reference.go +++ b/pkg/types/reference.go @@ -11,10 +11,11 @@ import ( "reflect" "strings" + "k8s.io/utils/ptr" + "github.com/crossplane/upjet/pkg/types/comments" "github.com/crossplane/upjet/pkg/types/markers" "github.com/crossplane/upjet/pkg/types/name" - "k8s.io/utils/ptr" ) const ( diff --git a/pkg/types/reference_test.go b/pkg/types/reference_test.go index cf012348..ed239af8 100644 --- a/pkg/types/reference_test.go +++ b/pkg/types/reference_test.go @@ -9,10 +9,11 @@ import ( "go/types" "testing" - "github.com/crossplane/upjet/pkg/config" - "github.com/crossplane/upjet/pkg/types/name" "github.com/google/go-cmp/cmp" twtypes "github.com/muvaf/typewriter/pkg/types" + + "github.com/crossplane/upjet/pkg/config" + "github.com/crossplane/upjet/pkg/types/name" ) func TestBuilder_generateReferenceFields(t *testing.T) {