From 61ad7659a5344b3d5513bb4cbe3f8e4a5d094115 Mon Sep 17 00:00:00 2001 From: George Pollard Date: Mon, 20 Sep 2021 10:17:30 +1200 Subject: [PATCH] Fix golangci linter error --- pkg/crd/schema_test.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pkg/crd/schema_test.go b/pkg/crd/schema_test.go index 07bb07681..bd46858e3 100644 --- a/pkg/crd/schema_test.go +++ b/pkg/crd/schema_test.go @@ -24,12 +24,12 @@ import ( "github.com/onsi/gomega" "golang.org/x/tools/go/packages" pkgstest "golang.org/x/tools/go/packages/packagestest" - v1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" + apiext "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" testloader "sigs.k8s.io/controller-tools/pkg/loader/testutils" "sigs.k8s.io/controller-tools/pkg/markers" ) -func transform(t *testing.T, expr string) *v1.JSONSchemaProps { +func transform(t *testing.T, expr string) *apiext.JSONSchemaProps { // this is *very* hacky but I haven’t found a simple way // to get an ast.Expr with all the associated metadata required // to run typeToSchema upon it: @@ -82,10 +82,10 @@ func failIfErrors(t *testing.T, errs []packages.Error) { } } -var arrayOfNumbersSchema *v1.JSONSchemaProps = &v1.JSONSchemaProps{ +var arrayOfNumbersSchema *apiext.JSONSchemaProps = &apiext.JSONSchemaProps{ Type: "array", - Items: &v1.JSONSchemaPropsOrArray{ - Schema: &v1.JSONSchemaProps{ + Items: &apiext.JSONSchemaPropsOrArray{ + Schema: &apiext.JSONSchemaProps{ Type: "number", }, }, @@ -102,9 +102,9 @@ func Test_Schema_MapOfStringToArrayOfFloat32(t *testing.T) { g := gomega.NewWithT(t) output := transform(t, "map[string][]float32") - g.Expect(output).To(gomega.Equal(&v1.JSONSchemaProps{ + g.Expect(output).To(gomega.Equal(&apiext.JSONSchemaProps{ Type: "object", - AdditionalProperties: &v1.JSONSchemaPropsOrBool{ + AdditionalProperties: &apiext.JSONSchemaPropsOrBool{ Allows: true, Schema: arrayOfNumbersSchema, },