Skip to content

Commit c645f1d

Browse files
migrate to ginkgo 2
1 parent 4140908 commit c645f1d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+149
-197
lines changed

go.mod

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ go 1.17
55
require (
66
github.com/cloudflare/cfssl v1.5.0 // for `kubebuilder alpha config-gen`
77
github.com/gobuffalo/flect v0.2.5
8-
github.com/onsi/ginkgo v1.16.5
9-
github.com/onsi/gomega v1.18.1
8+
github.com/onsi/ginkgo/v2 v2.1.4
9+
github.com/onsi/gomega v1.19.0
1010
github.com/sirupsen/logrus v1.8.1
1111
github.com/spf13/afero v1.6.0
1212
github.com/spf13/cobra v1.4.0
1313
github.com/spf13/pflag v1.0.5
1414
golang.org/x/text v0.3.7
15-
golang.org/x/tools v0.1.10-0.20220218145154-897bd77cd717
15+
golang.org/x/tools v0.1.10
1616
k8s.io/apimachinery v0.24.2 // for `kubebuilder alpha config-gen`
1717
sigs.k8s.io/controller-runtime v0.12.2 // for `kubebuilder alpha config-gen`
1818
sigs.k8s.io/controller-tools v0.9.2 // for `kubebuilder alpha config-gen`
@@ -25,7 +25,6 @@ require (
2525
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
2626
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a // indirect
2727
github.com/davecgh/go-spew v1.1.1 // indirect
28-
github.com/fsnotify/fsnotify v1.5.1 // indirect
2928
github.com/go-errors/errors v1.0.1 // indirect
3029
github.com/go-logr/logr v1.2.0 // indirect
3130
github.com/go-openapi/jsonpointer v0.19.5 // indirect
@@ -44,7 +43,6 @@ require (
4443
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
4544
github.com/modern-go/reflect2 v1.0.2 // indirect
4645
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect
47-
github.com/nxadm/tail v1.4.8 // indirect
4846
github.com/pkg/errors v0.9.1 // indirect
4947
github.com/pmezard/go-difflib v1.0.0 // indirect
5048
github.com/stretchr/testify v1.7.0 // indirect
@@ -54,12 +52,11 @@ require (
5452
github.com/zmap/zlint/v2 v2.2.1 // indirect
5553
golang.org/x/crypto v0.0.0-20220214200702-86341886e292 // indirect
5654
golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3 // indirect
57-
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd // indirect
58-
golang.org/x/sys v0.0.0-20220209214540-3681064d5158 // indirect
55+
golang.org/x/net v0.0.0-20220225172249-27dd8689420f // indirect
56+
golang.org/x/sys v0.0.0-20220319134239-a9b59b0215f8 // indirect
5957
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
6058
google.golang.org/protobuf v1.27.1 // indirect
6159
gopkg.in/inf.v0 v0.9.1 // indirect
62-
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
6360
gopkg.in/yaml.v2 v2.4.0 // indirect
6461
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
6562
k8s.io/api v0.24.2 // indirect

go.sum

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -395,14 +395,17 @@ github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9k
395395
github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0=
396396
github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE=
397397
github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU=
398-
github.com/onsi/ginkgo/v2 v2.0.0 h1:CcuG/HvWNkkaqCUpJifQY8z7qEMBJya6aLPx6ftGyjQ=
399398
github.com/onsi/ginkgo/v2 v2.0.0/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c=
399+
github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c=
400+
github.com/onsi/ginkgo/v2 v2.1.4 h1:GNapqRSid3zijZ9H77KrgVG4/8KqiyRsxcSxe+7ApXY=
401+
github.com/onsi/ginkgo/v2 v2.1.4/go.mod h1:um6tUpWM/cxCK3/FK8BXqEiUMUwRgSM4JXG47RKZmLU=
400402
github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA=
401403
github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
402404
github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
403405
github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY=
404-
github.com/onsi/gomega v1.18.1 h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE=
405406
github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs=
407+
github.com/onsi/gomega v1.19.0 h1:4ieX6qQjPP/BfC3mpsAtIGGlxTWPeA3Inl/7DtXw1tw=
408+
github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro=
406409
github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk=
407410
github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
408411
github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
@@ -662,8 +665,9 @@ golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qx
662665
golang.org/x/net v0.0.0-20210825183410-e898025ed96a/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
663666
golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
664667
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
665-
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd h1:O7DYs+zxREGLKzKoMQrtrEacpb0ZVXA5rIwylE2Xchk=
666668
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
669+
golang.org/x/net v0.0.0-20220225172249-27dd8689420f h1:oA4XRj0qtSt8Yo1Zms0CUlsT3KG69V2UGQWPBxujDmc=
670+
golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
667671
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
668672
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
669673
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
@@ -756,8 +760,9 @@ golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e/go.mod h1:oPkhp1MJrh7nUepCBc
756760
golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
757761
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
758762
golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
759-
golang.org/x/sys v0.0.0-20220209214540-3681064d5158 h1:rm+CHSpPEEW2IsXUib1ThaHIjuBVZjxNgSKmBLFfD4c=
760763
golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
764+
golang.org/x/sys v0.0.0-20220319134239-a9b59b0215f8 h1:OH54vjqzRWmbJ62fjuhxy7AxFFgoHN0/DPc/UrL8cAs=
765+
golang.org/x/sys v0.0.0-20220319134239-a9b59b0215f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
761766
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
762767
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
763768
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
@@ -833,8 +838,9 @@ golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4f
833838
golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0=
834839
golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
835840
golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
836-
golang.org/x/tools v0.1.10-0.20220218145154-897bd77cd717 h1:hI3jKY4Hpf63ns040onEbB3dAkR/H/P83hw1TG8dD3Y=
837841
golang.org/x/tools v0.1.10-0.20220218145154-897bd77cd717/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E=
842+
golang.org/x/tools v0.1.10 h1:QjFRCZxdOhBJ/UNgnBZLbNV13DlbnK0quyivTnXJM20=
843+
golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E=
838844
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
839845
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
840846
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=

pkg/cli/cli_test.go

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ import (
2222
"os"
2323
"strings"
2424

25-
. "github.com/onsi/ginkgo"
26-
. "github.com/onsi/ginkgo/extensions/table"
25+
. "github.com/onsi/ginkgo/v2"
2726
. "github.com/onsi/gomega"
2827
"github.com/spf13/afero"
2928
"github.com/spf13/cobra"
@@ -123,7 +122,8 @@ plugins:
123122
Expect(c.projectVersion.Compare(
124123
config.Version{
125124
Number: 3,
126-
Stage: stage.Stable})).To(Equal(0))
125+
Stage: stage.Stable,
126+
})).To(Equal(0))
127127
})
128128
It("should fail when stable is not registered ", func() {
129129
// overwrite project file with fake 4-alpha
@@ -312,9 +312,7 @@ plugins:
312312
})
313313

314314
Context("getInfoFromDefaults", func() {
315-
var (
316-
pluginKeys = []string{"go.kubebuilder.io/v2"}
317-
)
315+
pluginKeys := []string{"go.kubebuilder.io/v2"}
318316

319317
It("should be a no-op if already have plugin keys", func() {
320318
c.pluginKeys = pluginKeys
@@ -352,17 +350,15 @@ plugins:
352350
})
353351

354352
Context("resolvePlugins", func() {
355-
var (
356-
pluginKeys = []string{
357-
"foo.example.com/v1",
358-
"bar.example.com/v1",
359-
"baz.example.com/v1",
360-
"foo.kubebuilder.io/v1",
361-
"foo.kubebuilder.io/v2",
362-
"bar.kubebuilder.io/v1",
363-
"bar.kubebuilder.io/v2",
364-
}
365-
)
353+
pluginKeys := []string{
354+
"foo.example.com/v1",
355+
"bar.example.com/v1",
356+
"baz.example.com/v1",
357+
"foo.kubebuilder.io/v1",
358+
"foo.kubebuilder.io/v2",
359+
"bar.kubebuilder.io/v1",
360+
"bar.kubebuilder.io/v2",
361+
}
366362

367363
plugins := makeMockPluginsFor(projectVersion, pluginKeys...)
368364
plugins = append(plugins,
@@ -575,9 +571,7 @@ plugins:
575571
const (
576572
deprecationWarning = "DEPRECATED"
577573
)
578-
var (
579-
deprecatedPlugin = newMockDeprecatedPlugin("deprecated", "v1", deprecationWarning, projectVersion)
580-
)
574+
deprecatedPlugin := newMockDeprecatedPlugin("deprecated", "v1", deprecationWarning, projectVersion)
581575

582576
// Overwrite stdout to read the output and reset it afterwards
583577
r, w, _ := os.Pipe()
@@ -602,5 +596,4 @@ plugins:
602596
})
603597
})
604598
})
605-
606599
})

pkg/cli/options_test.go

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ import (
2222
"path/filepath"
2323
"runtime"
2424

25-
. "github.com/onsi/ginkgo"
26-
. "github.com/onsi/ginkgo/extensions/table"
25+
. "github.com/onsi/ginkgo/v2"
2726
. "github.com/onsi/gomega"
2827
"github.com/spf13/afero"
2928
"github.com/spf13/cobra"
@@ -63,7 +62,7 @@ var _ = Describe("Discover external plugins", func() {
6362
pluginFileName = "externalPlugin.sh"
6463
pluginFilePath = filepath.Join(pluginPath, "externalPlugin", "v1", pluginFileName)
6564

66-
err = fs.FS.MkdirAll(filepath.Dir(pluginFilePath), 0700)
65+
err = fs.FS.MkdirAll(filepath.Dir(pluginFilePath), 0o700)
6766
Expect(err).To(BeNil())
6867

6968
f, err = fs.FS.Create(pluginFilePath)
@@ -125,7 +124,6 @@ var _ = Describe("Discover external plugins", func() {
125124

126125
Expect(ps[0].Name()).To(Equal("externalPlugin"))
127126
Expect(ps[1].Name()).To(Equal("myotherexternalPlugin"))
128-
129127
})
130128

131129
Context("that are invalid", func() {
@@ -136,14 +134,13 @@ var _ = Describe("Discover external plugins", func() {
136134

137135
pluginPath, err = getPluginsRoot(runtime.GOOS)
138136
Expect(err).To(BeNil())
139-
140137
})
141138

142139
It("should error if the plugin found is not an executable", func() {
143140
pluginFileName = "externalPlugin.sh"
144141
pluginFilePath = filepath.Join(pluginPath, "externalPlugin", "v1", pluginFileName)
145142

146-
err = fs.FS.MkdirAll(filepath.Dir(pluginFilePath), 0700)
143+
err = fs.FS.MkdirAll(filepath.Dir(pluginFilePath), 0o700)
147144
Expect(err).To(BeNil())
148145

149146
f, err := fs.FS.Create(pluginFilePath)
@@ -154,21 +151,20 @@ var _ = Describe("Discover external plugins", func() {
154151
Expect(err).To(BeNil())
155152

156153
// set the plugin file permissions to read-only
157-
err = fs.FS.Chmod(pluginFilePath, 0444)
154+
err = fs.FS.Chmod(pluginFilePath, 0o444)
158155
Expect(err).To(Not(HaveOccurred()))
159156

160157
ps, err := DiscoverExternalPlugins(fs.FS)
161158
Expect(err).NotTo(BeNil())
162159
Expect(err.Error()).To(ContainSubstring("not an executable"))
163160
Expect(len(ps)).To(Equal(0))
164-
165161
})
166162

167163
It("should error if the plugin found has an invalid plugin name", func() {
168164
pluginFileName = ".sh"
169165
pluginFilePath = filepath.Join(pluginPath, "externalPlugin", "v1", pluginFileName)
170166

171-
err = fs.FS.MkdirAll(filepath.Dir(pluginFilePath), 0700)
167+
err = fs.FS.MkdirAll(filepath.Dir(pluginFilePath), 0o700)
172168
Expect(err).To(BeNil())
173169

174170
f, err = fs.FS.Create(pluginFilePath)
@@ -179,7 +175,6 @@ var _ = Describe("Discover external plugins", func() {
179175
Expect(err).NotTo(BeNil())
180176
Expect(err.Error()).To(ContainSubstring("Invalid plugin name found"))
181177
Expect(len(ps)).To(Equal(0))
182-
183178
})
184179
})
185180

@@ -191,14 +186,13 @@ var _ = Describe("Discover external plugins", func() {
191186

192187
pluginPath, err = getPluginsRoot(runtime.GOOS)
193188
Expect(err).To(BeNil())
194-
195189
})
196190

197191
It("should skip adding the external plugin and not return any errors", func() {
198192
pluginFileName = "random.sh"
199193
pluginFilePath = filepath.Join(pluginPath, "externalPlugin", "v1", pluginFileName)
200194

201-
err = fs.FS.MkdirAll(filepath.Dir(pluginFilePath), 0700)
195+
err = fs.FS.MkdirAll(filepath.Dir(pluginFilePath), 0o700)
202196
Expect(err).To(BeNil())
203197

204198
f, err = fs.FS.Create(pluginFilePath)
@@ -211,11 +205,10 @@ var _ = Describe("Discover external plugins", func() {
211205
ps, err := DiscoverExternalPlugins(fs.FS)
212206
Expect(err).To(BeNil())
213207
Expect(len(ps)).To(Equal(0))
214-
215208
})
216209

217210
It("should fail if pluginsroot is empty", func() {
218-
var errPluginsRoot = errors.New("could not retrieve plugins root")
211+
errPluginsRoot := errors.New("could not retrieve plugins root")
219212
retrievePluginsRoot = func(host string) (string, error) {
220213
return "", errPluginsRoot
221214
}
@@ -224,7 +217,6 @@ var _ = Describe("Discover external plugins", func() {
224217
Expect(err).NotTo(BeNil())
225218

226219
Expect(err).To(Equal(errPluginsRoot))
227-
228220
})
229221

230222
It("should fail for any other host that is not supported", func() {
@@ -280,7 +272,6 @@ var _ = Describe("Discover external plugins", func() {
280272
Expect(pluginsroot).To(Equal(""))
281273
Expect(err.Error()).To(ContainSubstring("error retrieving home dir"))
282274
})
283-
284275
})
285276
})
286277

@@ -323,7 +314,6 @@ var _ = Describe("Discover external plugins", func() {
323314
})
324315

325316
var _ = Describe("CLI options", func() {
326-
327317
const (
328318
pluginName = "plugin"
329319
pluginVersion = "v1"
@@ -549,5 +539,4 @@ var _ = Describe("CLI options", func() {
549539
Expect(c.completionCommand).To(BeTrue())
550540
})
551541
})
552-
553542
})

pkg/cli/resource_test.go

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

1919
import (
20-
. "github.com/onsi/ginkgo"
21-
. "github.com/onsi/ginkgo/extensions/table"
20+
. "github.com/onsi/ginkgo/v2"
2221
. "github.com/onsi/gomega"
2322

2423
"sigs.k8s.io/kubebuilder/v3/pkg/model/resource"

pkg/cli/suite_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ package cli
1919
import (
2020
"testing"
2121

22-
. "github.com/onsi/ginkgo"
22+
. "github.com/onsi/ginkgo/v2"
2323
. "github.com/onsi/gomega"
2424

2525
"sigs.k8s.io/kubebuilder/v3/pkg/config"

pkg/config/errors_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ package config
1919
import (
2020
"fmt"
2121

22-
. "github.com/onsi/ginkgo"
22+
. "github.com/onsi/ginkgo/v2"
2323
. "github.com/onsi/gomega"
2424

2525
"sigs.k8s.io/kubebuilder/v3/pkg/model/resource"
2626
)
2727

2828
var _ = Describe("UnsupportedVersionError", func() {
29-
var err = UnsupportedVersionError{
29+
err := UnsupportedVersionError{
3030
Version: Version{Number: 1},
3131
}
3232

@@ -38,7 +38,7 @@ var _ = Describe("UnsupportedVersionError", func() {
3838
})
3939

4040
var _ = Describe("UnsupportedFieldError", func() {
41-
var err = UnsupportedFieldError{
41+
err := UnsupportedFieldError{
4242
Version: Version{Number: 1},
4343
Field: "name",
4444
}
@@ -51,7 +51,7 @@ var _ = Describe("UnsupportedFieldError", func() {
5151
})
5252

5353
var _ = Describe("ResourceNotFoundError", func() {
54-
var err = ResourceNotFoundError{
54+
err := ResourceNotFoundError{
5555
GVK: resource.GVK{
5656
Group: "group",
5757
Domain: "my.domain",
@@ -68,7 +68,7 @@ var _ = Describe("ResourceNotFoundError", func() {
6868
})
6969

7070
var _ = Describe("PluginKeyNotFoundError", func() {
71-
var err = PluginKeyNotFoundError{
71+
err := PluginKeyNotFoundError{
7272
Key: "go.kubebuilder.io/v1",
7373
}
7474

pkg/config/registry_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ limitations under the License.
1717
package config
1818

1919
import (
20-
. "github.com/onsi/ginkgo"
20+
. "github.com/onsi/ginkgo/v2"
2121
. "github.com/onsi/gomega"
2222
)
2323

@@ -62,5 +62,4 @@ var _ = Describe("registry", func() {
6262
Expect(err).To(HaveOccurred())
6363
})
6464
})
65-
6665
})

pkg/config/store/errors_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
"fmt"
2121
"testing"
2222

23-
. "github.com/onsi/ginkgo"
23+
. "github.com/onsi/ginkgo/v2"
2424
. "github.com/onsi/gomega"
2525
)
2626

0 commit comments

Comments
 (0)