3
3
// implemented by this validation library.
4
4
//
5
5
// Each default Validator runs an independent set of validation functions on
6
- // a set of objects. To run all implemented Validator's, use DefaultValidators() .
7
- // The Validator will not be run on objects not of the appropriate type.
6
+ // a set of objects. To run all implemented Validator's, use AllValidators .
7
+ // The Validator will not be run on objects of an inappropriate type.
8
8
9
9
package validation
10
10
@@ -13,50 +13,29 @@ import (
13
13
"github.com/operator-framework/api/pkg/validation/internal"
14
14
)
15
15
16
- // DefaultPackageManifestValidators returns a package manifest Validator that
17
- // can be run directly with Apply(objs...). Optionally, any additional
18
- // Validator's can be added to the returned Validators set.
19
- func DefaultPackageManifestValidators (vals ... interfaces.Validator ) interfaces.Validators {
20
- return append (vals , internal.PackageManifestValidator {})
21
- }
16
+ // PackageManifestValidator implements Validator to validate package manifests.
17
+ var PackageManifestValidator = internal .PackageManifestValidator
22
18
23
- // DefaultClusterServiceVersionValidators returns a ClusterServiceVersion
24
- // Validator that can be run directly with Apply(objs...). Optionally, any
25
- // additional Validator's can be added to the returned Validators set.
26
- func DefaultClusterServiceVersionValidators (vals ... interfaces.Validator ) interfaces.Validators {
27
- return append (vals , internal.CSVValidator {})
28
- }
19
+ // ClusterServiceVersionValidator implements Validator to validate
20
+ // ClusterServiceVersions.
21
+ var ClusterServiceVersionValidator = internal .CSVValidator
29
22
30
- // DefaultCustomResourceDefinitionValidators returns a CustomResourceDefinition
31
- // Validator that can be run directly with Apply(objs...). Optionally, any
32
- // additional Validator's can be added to the returned Validators set.
33
- func DefaultCustomResourceDefinitionValidators (vals ... interfaces.Validator ) interfaces.Validators {
34
- return append (vals , internal.CRDValidator {})
35
- }
23
+ // CustomResourceDefinitionValidator implements Validator to validate
24
+ // CustomResourceDefinitions.
25
+ var CustomResourceDefinitionValidator = internal .CRDValidator
36
26
37
- // DefaultBundleValidators returns a bundle Validator that can be run directly
38
- // with Apply(objs...). Optionally, any additional Validator's can be added to
39
- // the returned Validators set.
40
- func DefaultBundleValidators (vals ... interfaces.Validator ) interfaces.Validators {
41
- return append (vals , internal.BundleValidator {})
42
- }
27
+ // BundleValidator implements Validator to validate Bundles.
28
+ var BundleValidator = internal .BundleValidator
43
29
44
- // DefaultManifestsValidators returns a manifests Validator that can be run
45
- // directly with Apply(objs...). Optionally, any additional Validator's can be
46
- // added to the returned Validators set.
47
- func DefaultManifestsValidators (vals ... interfaces.Validator ) interfaces.Validators {
48
- return append (vals , internal.ManifestsValidator {})
49
- }
30
+ // PackageUpdateGraphValidator implements Validator to validate the
31
+ // package update graph between a package manifest and Bundles.
32
+ var PackageUpdateGraphValidator = internal .PackageUpdateGraphValidator
50
33
51
- // DefaultValidators returns all default Validator's, which can be run directly
52
- // with Apply(objs...). Optionally, any additional Validator's can be added to
53
- // the returned Validators set.
54
- func DefaultValidators (vals ... interfaces.Validator ) interfaces.Validators {
55
- return append (vals ,
56
- internal.PackageManifestValidator {},
57
- internal.CSVValidator {},
58
- internal.CRDValidator {},
59
- internal.BundleValidator {},
60
- internal.ManifestsValidator {},
61
- )
34
+ // AllValidators implements Validator to validate all Operator manifest types.
35
+ var AllValidators = interfaces.Validators {
36
+ PackageManifestValidator ,
37
+ ClusterServiceVersionValidator ,
38
+ CustomResourceDefinitionValidator ,
39
+ BundleValidator ,
40
+ PackageUpdateGraphValidator ,
62
41
}
0 commit comments