1
- package crd_constraints_test
1
+ package crdconstraints_test
2
2
3
3
import (
4
4
"context"
@@ -12,10 +12,10 @@ import (
12
12
"github.com/operator-framework/deppy/pkg/deppy/input"
13
13
"github.com/operator-framework/operator-registry/alpha/property"
14
14
15
- "github.com/operator-framework/operator-controller/internal/resolution/variable_sources/bundles_and_dependencies "
16
- "github.com/operator-framework/operator-controller/internal/resolution/variable_sources/crd_constraints "
15
+ "github.com/operator-framework/operator-controller/internal/resolution/variable_sources/bundlesanddependencies "
16
+ "github.com/operator-framework/operator-controller/internal/resolution/variable_sources/crdconstraints "
17
17
olmentity "github.com/operator-framework/operator-controller/internal/resolution/variable_sources/entity"
18
- "github.com/operator-framework/operator-controller/internal/resolution/variable_sources/required_package "
18
+ "github.com/operator-framework/operator-controller/internal/resolution/variable_sources/requiredpackage "
19
19
)
20
20
21
21
func TestGlobalConstraints (t * testing.T ) {
@@ -27,7 +27,7 @@ var _ = Describe("BundleUniquenessVariable", func() {
27
27
var (
28
28
id deppy.Identifier
29
29
atMostIDs []deppy.Identifier
30
- globalConstraintVariable * crd_constraints .BundleUniquenessVariable
30
+ globalConstraintVariable * crdconstraints .BundleUniquenessVariable
31
31
)
32
32
33
33
BeforeEach (func () {
@@ -36,7 +36,7 @@ var _ = Describe("BundleUniquenessVariable", func() {
36
36
deppy .IdentifierFromString ("test-at-most-id-1" ),
37
37
deppy .IdentifierFromString ("test-at-most-id-2" ),
38
38
}
39
- globalConstraintVariable = crd_constraints .NewBundleUniquenessVariable (id , atMostIDs ... )
39
+ globalConstraintVariable = crdconstraints .NewBundleUniquenessVariable (id , atMostIDs ... )
40
40
})
41
41
42
42
It ("should initialize a new global constraint variable" , func () {
@@ -145,14 +145,14 @@ var bundleSet = map[deppy.Identifier]*input.Entity{
145
145
var _ = Describe ("CRDUniquenessConstraintsVariableSource" , func () {
146
146
var (
147
147
inputVariableSource * MockInputVariableSource
148
- crdConstraintVariableSource * crd_constraints .CRDUniquenessConstraintsVariableSource
148
+ crdConstraintVariableSource * crdconstraints .CRDUniquenessConstraintsVariableSource
149
149
ctx context.Context
150
150
entitySource input.EntitySource
151
151
)
152
152
153
153
BeforeEach (func () {
154
154
inputVariableSource = & MockInputVariableSource {}
155
- crdConstraintVariableSource = crd_constraints .NewCRDUniquenessConstraintsVariableSource (inputVariableSource )
155
+ crdConstraintVariableSource = crdconstraints .NewCRDUniquenessConstraintsVariableSource (inputVariableSource )
156
156
ctx = context .Background ()
157
157
158
158
// the entity is not used in this variable source
@@ -161,16 +161,16 @@ var _ = Describe("CRDUniquenessConstraintsVariableSource", func() {
161
161
162
162
It ("should get variables from the input variable source and create global constraint variables" , func () {
163
163
inputVariableSource .ResultSet = []deppy.Variable {
164
- required_package .NewRequiredPackageVariable ("test-package" , []* olmentity.BundleEntity {
164
+ requiredpackage .NewRequiredPackageVariable ("test-package" , []* olmentity.BundleEntity {
165
165
olmentity .NewBundleEntity (bundleSet ["bundle-2" ]),
166
166
olmentity .NewBundleEntity (bundleSet ["bundle-1" ]),
167
167
}),
168
- required_package .NewRequiredPackageVariable ("test-package-2" , []* olmentity.BundleEntity {
168
+ requiredpackage .NewRequiredPackageVariable ("test-package-2" , []* olmentity.BundleEntity {
169
169
olmentity .NewBundleEntity (bundleSet ["bundle-14" ]),
170
170
olmentity .NewBundleEntity (bundleSet ["bundle-15" ]),
171
171
olmentity .NewBundleEntity (bundleSet ["bundle-16" ]),
172
172
}),
173
- bundles_and_dependencies .NewBundleVariable (
173
+ bundlesanddependencies .NewBundleVariable (
174
174
olmentity .NewBundleEntity (bundleSet ["bundle-2" ]),
175
175
[]* olmentity.BundleEntity {
176
176
olmentity .NewBundleEntity (bundleSet ["bundle-3" ]),
@@ -180,70 +180,70 @@ var _ = Describe("CRDUniquenessConstraintsVariableSource", func() {
180
180
olmentity .NewBundleEntity (bundleSet ["bundle-7" ]),
181
181
},
182
182
),
183
- bundles_and_dependencies .NewBundleVariable (
183
+ bundlesanddependencies .NewBundleVariable (
184
184
olmentity .NewBundleEntity (bundleSet ["bundle-1" ]),
185
185
[]* olmentity.BundleEntity {
186
186
olmentity .NewBundleEntity (bundleSet ["bundle-6" ]),
187
187
olmentity .NewBundleEntity (bundleSet ["bundle-7" ]),
188
188
olmentity .NewBundleEntity (bundleSet ["bundle-8" ]),
189
189
},
190
190
),
191
- bundles_and_dependencies .NewBundleVariable (
191
+ bundlesanddependencies .NewBundleVariable (
192
192
olmentity .NewBundleEntity (bundleSet ["bundle-3" ]),
193
193
[]* olmentity.BundleEntity {},
194
194
),
195
- bundles_and_dependencies .NewBundleVariable (
195
+ bundlesanddependencies .NewBundleVariable (
196
196
olmentity .NewBundleEntity (bundleSet ["bundle-4" ]),
197
197
[]* olmentity.BundleEntity {},
198
198
),
199
- bundles_and_dependencies .NewBundleVariable (
199
+ bundlesanddependencies .NewBundleVariable (
200
200
olmentity .NewBundleEntity (bundleSet ["bundle-5" ]),
201
201
[]* olmentity.BundleEntity {},
202
202
),
203
- bundles_and_dependencies .NewBundleVariable (
203
+ bundlesanddependencies .NewBundleVariable (
204
204
olmentity .NewBundleEntity (bundleSet ["bundle-6" ]),
205
205
[]* olmentity.BundleEntity {},
206
206
),
207
- bundles_and_dependencies .NewBundleVariable (
207
+ bundlesanddependencies .NewBundleVariable (
208
208
olmentity .NewBundleEntity (bundleSet ["bundle-7" ]),
209
209
[]* olmentity.BundleEntity {
210
210
olmentity .NewBundleEntity (bundleSet ["bundle-8" ]),
211
211
olmentity .NewBundleEntity (bundleSet ["bundle-9" ]),
212
212
olmentity .NewBundleEntity (bundleSet ["bundle-10" ]),
213
213
},
214
214
),
215
- bundles_and_dependencies .NewBundleVariable (
215
+ bundlesanddependencies .NewBundleVariable (
216
216
olmentity .NewBundleEntity (bundleSet ["bundle-8" ]),
217
217
[]* olmentity.BundleEntity {},
218
218
),
219
- bundles_and_dependencies .NewBundleVariable (
219
+ bundlesanddependencies .NewBundleVariable (
220
220
olmentity .NewBundleEntity (bundleSet ["bundle-9" ]),
221
221
[]* olmentity.BundleEntity {},
222
222
),
223
- bundles_and_dependencies .NewBundleVariable (
223
+ bundlesanddependencies .NewBundleVariable (
224
224
olmentity .NewBundleEntity (bundleSet ["bundle-10" ]),
225
225
[]* olmentity.BundleEntity {},
226
226
),
227
- bundles_and_dependencies .NewBundleVariable (
227
+ bundlesanddependencies .NewBundleVariable (
228
228
olmentity .NewBundleEntity (bundleSet ["bundle-14" ]),
229
229
[]* olmentity.BundleEntity {},
230
230
),
231
- bundles_and_dependencies .NewBundleVariable (
231
+ bundlesanddependencies .NewBundleVariable (
232
232
olmentity .NewBundleEntity (bundleSet ["bundle-15" ]),
233
233
[]* olmentity.BundleEntity {},
234
234
),
235
- bundles_and_dependencies .NewBundleVariable (
235
+ bundlesanddependencies .NewBundleVariable (
236
236
olmentity .NewBundleEntity (bundleSet ["bundle-16" ]),
237
237
[]* olmentity.BundleEntity {},
238
238
),
239
239
}
240
240
variables , err := crdConstraintVariableSource .GetVariables (ctx , entitySource )
241
241
Expect (err ).ToNot (HaveOccurred ())
242
242
Expect (variables ).To (HaveLen (26 ))
243
- var crdConstraintVariables []* crd_constraints .BundleUniquenessVariable
243
+ var crdConstraintVariables []* crdconstraints .BundleUniquenessVariable
244
244
for _ , variable := range variables {
245
245
switch v := variable .(type ) {
246
- case * crd_constraints .BundleUniquenessVariable :
246
+ case * crdconstraints .BundleUniquenessVariable :
247
247
crdConstraintVariables = append (crdConstraintVariables , v )
248
248
}
249
249
}
@@ -265,7 +265,7 @@ var _ = Describe("CRDUniquenessConstraintsVariableSource", func() {
265
265
266
266
It ("should return an error if input variable source returns an error" , func () {
267
267
inputVariableSource = & MockInputVariableSource {Err : fmt .Errorf ("error getting variables" )}
268
- crdConstraintVariableSource = crd_constraints .NewCRDUniquenessConstraintsVariableSource (inputVariableSource )
268
+ crdConstraintVariableSource = crdconstraints .NewCRDUniquenessConstraintsVariableSource (inputVariableSource )
269
269
_ , err := crdConstraintVariableSource .GetVariables (ctx , entitySource )
270
270
Expect (err ).To (HaveOccurred ())
271
271
Expect (err .Error ()).To (ContainSubstring ("error getting variables" ))
@@ -304,7 +304,7 @@ func (m *MockInputVariableSource) GetVariables(_ context.Context, _ input.Entity
304
304
return m .ResultSet , nil
305
305
}
306
306
307
- func CollectGlobalConstraintVariableIDs (vars []* crd_constraints .BundleUniquenessVariable ) []string {
307
+ func CollectGlobalConstraintVariableIDs (vars []* crdconstraints .BundleUniquenessVariable ) []string {
308
308
ids := make ([]string , 0 , len (vars ))
309
309
for _ , v := range vars {
310
310
ids = append (ids , v .Identifier ().String ())
0 commit comments