Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileValidator ¶
type FileValidator interface {
Validate(data []byte) []ValidationResult
}
type OpenApiValidator ¶
type OpenApiValidator struct {
// contains filtered or unexported fields
}
OpenApiValidator validates Kubernetes manifests using OpenApi schemas
func NewOpenApi2Validator ¶
func NewOpenApi2Validator(openApi2SpecsBytes []byte) (*OpenApiValidator, error)
func (OpenApiValidator) AddCrdSchemas ¶
func (oeValidator OpenApiValidator) AddCrdSchemas(crdResource kubernetes.Resource) error
AddCrdSchemas adds additional schemas from a CustomResourceDefinition that can be used to validate other resources TODO: <09-08-20, @fllaca> // more generic way of handling CRDs? :thinking:
func (OpenApiValidator) Validate ¶
func (oeValidator OpenApiValidator) Validate(input map[string]interface{}) ValidationResult
type ResourceValidator ¶
type ResourceValidator interface {
Validate(resource map[string]interface{}) ValidationResult
}
type ValidationResult ¶
type ValidationResult struct { // Message holds a brief description of the validation result Message string // Severity specifies if the validation is OK/ERROR/WARNING Severity Severity // Name of the validated resourcce Name string // Namespace of the validated resourcce Namespace string // Kind of the validated resourcce Kind string }
type YamlFileValidator ¶
type YamlFileValidator struct {
// contains filtered or unexported fields
}
func NewYamlFileValidator ¶
func NewYamlFileValidator(resourceValidator ResourceValidator) YamlFileValidator
func (YamlFileValidator) Validate ¶
func (yamlValidator YamlFileValidator) Validate(fileBytes []byte) []ValidationResult
Click to show internal directories.
Click to hide internal directories.