Documentation ¶
Index ¶
- Variables
- func CLIMiddlewares(v types.Validator) types.Validator
- func Error(err error) types.ValidatorResult
- func Fail(msgs ...string) types.ValidatorResult
- func GenerateOCMSKUValidator(ocm OCMClient) types.ValidateFunc
- func IsOCMServerSideError(err error) bool
- func NewValidatorsRegistry() *defaultRegistry
- func RetryMiddleware(v types.Validator) types.Validator
- func RetryableError(err error) types.ValidatorResult
- func Success() types.ValidatorResult
- func ValidateAddonParameters(mb types.MetaBundle) types.ValidatorResult
- func ValidateDmsSnitchNamePostFix(mb types.MetaBundle) types.ValidatorResult
- func ValidateIconBase64(mb types.MetaBundle) types.ValidatorResult
- func ValidateNamespace(mb types.MetaBundle) types.ValidatorResult
- func ValidateOCMSKUExists(mb types.MetaBundle) types.ValidatorResult
- func ValidateTestHarness(mb types.MetaBundle) types.ValidatorResult
- func Validatek8sResourceAndFieldNames(mb types.MetaBundle) types.ValidatorResult
- type CSVSpec
- type OCMClient
- type OCMError
- type QuotaRuleGetter
Constants ¶
This section is empty.
Variables ¶
View Source
var AM0001 = types.Validator{
Code: "AM0001",
Name: "default_channel",
Description: "Ensure defaultChannel is present in list of channels",
Runner: validateDefaultChannel,
}
View Source
var AM0002 = types.Validator{
Code: "AM0002",
Name: "label_format",
Description: "Validates whether label follows the format 'api.openshift.com/addon-<id>'",
Runner: validateAddonLabel,
}
View Source
var AM0004 = types.Validator{ Code: "AM0004", Name: "icon_base64", Description: "Ensure that `icon` in Addon metadata is rightfully base64 encoded", Runner: ValidateIconBase64, }
View Source
var AM0005 = types.Validator{ Code: "AM0005", Name: "test_harness", Description: "Ensure that an addon has a valid testharness image", Runner: ValidateTestHarness, }
View Source
var AM0006 = types.Validator{ Code: "AM0006", Name: "dms_snitchnamepostfix", Description: "Ensure `deadmanssnitch.snitchNamePostFix` doesn't begin with 'hive-'", Runner: ValidateDmsSnitchNamePostFix, }
View Source
var AM0007 = types.Validator{
Code: "AM0007",
Name: "csv_install_modes",
Description: "Validate installMode is supported.",
Runner: validateCSVInstallModes,
}
View Source
var AM0008 = types.Validator{ Code: "AM0008", Name: "ensure_namespace", Description: "Ensure that the target namespace is listed in the set of channels listed", Runner: ValidateNamespace, }
View Source
var AM0009 = types.Validator{ Code: "AM0009", Name: "addon_parameters", Description: "Ensure `addOnParameters` section in the addon metadata is rightfully defined", Runner: ValidateAddonParameters, }
View Source
var AM0010 = types.Validator{ Code: "AM0010", Name: "k8s_resource_and_field_names", Description: "Validates k8s namespaces, labels, and annotations within Addon metadata against k8s standards", Runner: Validatek8sResourceAndFieldNames, }
View Source
var AM0011 = types.Validator{ Code: "AM0011", Name: "sku_validation", Description: "Validates whether a SKU Rule exists in OCM for quota provided in addon metadata", Runner: ValidateOCMSKUExists, }
View Source
var AM0012 = types.Validator{
Code: "AM0012",
Name: "csv_permissions",
Description: "validates the permissions specified in the csv",
Runner: validateCsvRbac,
}
View Source
var Registry = NewValidatorsRegistry()
Registry - holds all registered Validators
Functions ¶
func CLIMiddlewares ¶ added in v0.7.0
CLIMiddlewares - wraps a validator with all CLI Middlewares. Order is important!
func Error ¶ added in v0.7.0
func Error(err error) types.ValidatorResult
func Fail ¶ added in v0.7.0
func Fail(msgs ...string) types.ValidatorResult
func GenerateOCMSKUValidator ¶ added in v0.8.0
func GenerateOCMSKUValidator(ocm OCMClient) types.ValidateFunc
func IsOCMServerSideError ¶ added in v0.8.0
IsOCMServerSideError determines if the given error is both an instance of OCMError and was caused by a server-side issue.
func NewValidatorsRegistry ¶ added in v0.8.0
func NewValidatorsRegistry() *defaultRegistry
func RetryableError ¶ added in v0.7.0
func RetryableError(err error) types.ValidatorResult
RetryableError - used by the Retry middleware to automatically re-run validators
func Success ¶ added in v0.7.0
func Success() types.ValidatorResult
func ValidateAddonParameters ¶ added in v0.7.0
func ValidateAddonParameters(mb types.MetaBundle) types.ValidatorResult
func ValidateDmsSnitchNamePostFix ¶ added in v0.7.0
func ValidateDmsSnitchNamePostFix(mb types.MetaBundle) types.ValidatorResult
func ValidateIconBase64 ¶ added in v0.6.0
func ValidateIconBase64(mb types.MetaBundle) types.ValidatorResult
ValidateIconBase64 validates 'icon' in the addon metadata is rightfully base64 encoded
func ValidateNamespace ¶ added in v0.6.0
func ValidateNamespace(mb types.MetaBundle) types.ValidatorResult
func ValidateOCMSKUExists ¶ added in v0.8.0
func ValidateOCMSKUExists(mb types.MetaBundle) types.ValidatorResult
func ValidateTestHarness ¶ added in v0.6.0
func ValidateTestHarness(mb types.MetaBundle) types.ValidatorResult
func Validatek8sResourceAndFieldNames ¶ added in v0.8.0
func Validatek8sResourceAndFieldNames(mb types.MetaBundle) types.ValidatorResult
Types ¶
type CSVSpec ¶ added in v0.7.0
type CSVSpec struct {
InstallModes []operatorsv1alpha1.InstallMode `json:"installModes"`
}
type OCMClient ¶ added in v0.8.0
type OCMClient interface { QuotaRuleGetter // Stuck here until OCM Client can be injected via Params... CloseConnection() error }
OCMClient abstracts behavior required for validators which request data from OCM to be implemented by OCM API clients.
Source Files ¶
- am0001_default_channel.go
- am0002_addon_label.go
- am0004_icon_base64.go
- am0005_test_harness.go
- am0006_dms_snitchnamepostfix.go
- am0007_csv_install_modes.go
- am0008_namespace.go
- am0009_addon_parameters.go
- am0010_k8s_resource_names.go
- am0011_sku_validation.go
- am0012_csv_rbac.go
- middlewares.go
- ocm_client.go
- registry.go
- result.go
Click to show internal directories.
Click to hide internal directories.