...
1
16
17 package envtest
18
19 import (
20 . "github.com/onsi/ginkgo/v2"
21 . "github.com/onsi/gomega"
22 "k8s.io/apimachinery/pkg/util/sets"
23 )
24
25 var _ = Describe("Test", func() {
26 Describe("readCRDFiles", func() {
27 It("should not mix up files from different directories", func() {
28 opt := CRDInstallOptions{
29 Paths: []string{
30 "testdata/crds",
31 "testdata/crdv1_original",
32 },
33 }
34 err := readCRDFiles(&opt)
35 Expect(err).NotTo(HaveOccurred())
36
37 expectedCRDs := sets.NewString(
38 "frigates.ship.example.com",
39 "configs.foo.example.com",
40 "drivers.crew.example.com",
41 )
42
43 foundCRDs := sets.NewString()
44 for _, crd := range opt.CRDs {
45 foundCRDs.Insert(crd.Name)
46 }
47
48 Expect(expectedCRDs).To(Equal(foundCRDs))
49 })
50 })
51 })
52
View as plain text