Skip to content

Commit 445126c

Browse files
camilamacedo86timflannagan
authored andcommitted
doc operatorhub validator (openshift#159)
Signed-off-by: Camila Macedo <[email protected]> Upstream-repository: api Upstream-commit: dd58de2b37096fb5fcd8b5538cf58cfc811b113a
1 parent d30d1fa commit 445126c

File tree

2 files changed

+120
-2
lines changed

2 files changed

+120
-2
lines changed

staging/api/pkg/validation/internal/operatorhub.go

Lines changed: 60 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,68 @@ import (
2121
// OperatorHubValidator validates the bundle manifests against the required criteria to publish
2222
// the projects on OperatorHub.io.
2323
//
24+
// This validator will ensure that:
25+
// - The annotations capabilities into the CSV has a valid option, which are:
26+
// * "Basic Install"
27+
// * "Seamless Upgrades"
28+
// * "Full Lifecycle"
29+
// * "Deep Insights"
30+
// * "Auto Pilot"
31+
// - The annotations categories into the CSV has a valid option, which are:
32+
// * "AI/Machine Learning"
33+
// * "Application Runtime"
34+
// * "Big Data"
35+
// * "Cloud Provider"
36+
// * "Developer Tools"
37+
// * "Database"
38+
// * "Integration & Delivery"
39+
// * "Logging & Tracing"
40+
// * "Monitoring"
41+
// * "Networking"
42+
// * "OpenShift Optional"
43+
// * "Security"
44+
// * "Storage"
45+
// * "Streaming & Messaging"
46+
//
47+
// NOTE: The operatorhub validator can verify against custom bundle categories by setting the OPERATOR_BUNDLE_CATEGORIES
48+
// environment variable. Setting the OPERATOR_BUNDLE_CATEGORIES environment variable to the path to a json file
49+
// containing a list of categories will enable those categories to be used when comparing CSV categories for
50+
// operatorhub validation. The json file should be in the following format:
51+
//
52+
// ```json
53+
// {
54+
// "categories":[
55+
// "Cloud Pak",
56+
// "Registry",
57+
// "MyCoolThing",
58+
// ]
59+
// }
60+
// ```
61+
//
62+
// - The csv.Spec.Provider.Name was provided
63+
// - The csv.Spec.Maintainers elements contains both name and email
64+
// - The csv.Spec.Links elements contains both name and url
65+
// - The csv.Spec.Links.Url is a valid value
66+
// - The csv.Spec.Version is provided
67+
// - The checks.csv.Spec.Icon was provided and has not more than one element
68+
// - The csv.Spec.Icon elements should contain both data and mediatype
69+
// - The csv.Spec.Icon elements should contain both data and mediatype
70+
// - The csv.Spec.Icon has a valid mediatype, which are
71+
// * "image/gif"
72+
// * "image/jpeg"
73+
// * "image/png"
74+
// * "image/svg+xml"
75+
// - If informed ONLY, check if the value csv.Spec.MinKubeVersion is parsable according to semver (https://semver.org/)
76+
// Also, this validator will raise warnings when:
77+
// - The bundle name (CSV.metadata.name) does not follow the naming convention: <operator-name>.v<semver> e.g. memcached-operator.v0.0.1
78+
// NOTE: The bundle name must be 63 characters or less because it will be used as k8s ownerref label which only allows max of 63 characters.
79+
// - The channel names seems are not following the convention https://olm.operatorframework.io/docs/best-practices/channel-naming/
80+
// - The usage of the removed APIs on Kubernetes 1.22 is found. More info: https://kubernetes.io/docs/reference/using-api/deprecation-guide/#v1-22
81+
//
2482
// Note that this validator allows to receive a List of optional values as key=values. Currently, only the
2583
// `k8s-version` key is allowed. If informed, it will perform the checks against this specific Kubernetes version where the
26-
// operator bundle is intend to be distribute for.
84+
// operator bundle is intend to be used and will raise errors instead of warnings.
85+
// Currently, this check is capable of verifying the removed APIs only for Kubernetes 1.22 version.
2786
var OperatorHubValidator interfaces.Validator = interfaces.ValidatorFunc(validateOperatorHub)
2887

2988
var validCapabilities = map[string]struct{}{

vendor/github.com/operator-framework/api/pkg/validation/internal/operatorhub.go

Lines changed: 60 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)