@@ -18,6 +18,7 @@ package envtest
18
18
19
19
import (
20
20
"context"
21
+ "path/filepath"
21
22
22
23
"time"
23
24
@@ -60,7 +61,7 @@ var _ = Describe("Test", func() {
60
61
It ("should install the CRDs into the cluster" , func (done Done ) {
61
62
62
63
crds , err = InstallCRDs (env .Config , CRDInstallOptions {
63
- Paths : []string {"." },
64
+ Paths : []string {filepath . Join ( "." , "testdata" ) },
64
65
})
65
66
Expect (err ).NotTo (HaveOccurred ())
66
67
@@ -86,6 +87,11 @@ var _ = Describe("Test", func() {
86
87
Expect (err ).NotTo (HaveOccurred ())
87
88
Expect (crd .Spec .Names .Kind ).To (Equal ("FirstMate" ))
88
89
90
+ crd = & v1beta1.CustomResourceDefinition {}
91
+ err = c .Get (context .TODO (), types.NamespacedName {Name : "drivers.crew.example.com" }, crd )
92
+ Expect (err ).NotTo (HaveOccurred ())
93
+ Expect (crd .Spec .Names .Kind ).To (Equal ("Driver" ))
94
+
89
95
err = WaitForCRDs (env .Config , []* v1beta1.CustomResourceDefinition {
90
96
{
91
97
Spec : v1beta1.CustomResourceDefinitionSpec {
@@ -118,7 +124,24 @@ var _ = Describe("Test", func() {
118
124
Names : v1beta1.CustomResourceDefinitionNames {
119
125
Plural : "firstmates" ,
120
126
}},
121
- }},
127
+ },
128
+ {
129
+ Spec : v1beta1.CustomResourceDefinitionSpec {
130
+ Group : "crew.example.com" ,
131
+ Version : "v1" ,
132
+ Names : v1beta1.CustomResourceDefinitionNames {
133
+ Plural : "drivers" ,
134
+ }},
135
+ },
136
+ {
137
+ Spec : v1beta1.CustomResourceDefinitionSpec {
138
+ Group : "crew.example.com" ,
139
+ Version : "v2" ,
140
+ Names : v1beta1.CustomResourceDefinitionNames {
141
+ Plural : "drivers" ,
142
+ }},
143
+ },
144
+ },
122
145
CRDInstallOptions {maxTime : 50 * time .Millisecond , pollInterval : 15 * time .Millisecond },
123
146
)
124
147
Expect (err ).NotTo (HaveOccurred ())
@@ -145,9 +168,11 @@ var _ = Describe("Test", func() {
145
168
err := WaitForCRDs (env .Config ,
146
169
[]* v1beta1.CustomResourceDefinition {
147
170
{
148
- Spec : v1beta1.CustomResourceDefinitionSpec {Names : v1beta1.CustomResourceDefinitionNames {
149
- Plural : "notfound" ,
150
- }},
171
+ Spec : v1beta1.CustomResourceDefinitionSpec {
172
+ Version : "v1" ,
173
+ Names : v1beta1.CustomResourceDefinitionNames {
174
+ Plural : "notfound" ,
175
+ }},
151
176
},
152
177
},
153
178
CRDInstallOptions {maxTime : 50 * time .Millisecond , pollInterval : 15 * time .Millisecond },
0 commit comments