Documentation ¶
Index ¶
- type ContainsDocumentValidator
- type ContainsValidator
- type EqualRawValidator
- type EqualValidator
- type ExistsValidator
- type FailedTemplateValidator
- type HasDocumentsValidator
- type IsAPIVersionValidator
- type IsKindValidator
- type IsNullOrEmptyValidator
- type IsSubsetValidator
- type LengthEqualDocumentsValidator
- type MatchRegexRawValidator
- type MatchRegexValidator
- type MatchSnapshotRawValidator
- type MatchSnapshotValidator
- type SnapshotComparer
- type Validatable
- type ValidateContext
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContainsDocumentValidator ¶
type ContainsDocumentValidator struct { Kind string APIVersion string Name string // optional Namespace string // optional Any bool // optional }
ContainsDocumentValidator validate whether value of Path contains Content
func (ContainsDocumentValidator) Validate ¶
func (v ContainsDocumentValidator) Validate(context *ValidateContext) (bool, []string)
Validate implement Validatable
type ContainsValidator ¶
ContainsValidator validate whether value of Path is an array and contains Content
func (ContainsValidator) Validate ¶
func (v ContainsValidator) Validate(context *ValidateContext) (bool, []string)
Validate implement Validatable
type EqualRawValidator ¶
type EqualRawValidator struct {
Value string
}
EqualRawValidator validate whether the raw value equal to Value
func (EqualRawValidator) Validate ¶
func (a EqualRawValidator) Validate(context *ValidateContext) (bool, []string)
Validate implement Validatable
type EqualValidator ¶
type EqualValidator struct { Path string Value interface{} DecodeBase64 bool `yaml:"decodeBase64"` }
EqualValidator validate whether the value of Path equal to Value
func (EqualValidator) Validate ¶
func (a EqualValidator) Validate(context *ValidateContext) (bool, []string)
Validate implement Validatable
type ExistsValidator ¶ added in v0.3.2
type ExistsValidator struct {
Path string
}
ExistsValidator validate value of Path id kind
func (ExistsValidator) Validate ¶ added in v0.3.2
func (v ExistsValidator) Validate(context *ValidateContext) (bool, []string)
Validate implement Validatable
type FailedTemplateValidator ¶
type FailedTemplateValidator struct {
ErrorMessage string
}
FailedTemplateValidator validate whether the errorMessage equal to errorMessage
func (FailedTemplateValidator) Validate ¶
func (a FailedTemplateValidator) Validate(context *ValidateContext) (bool, []string)
Validate implement Validatable
type HasDocumentsValidator ¶
type HasDocumentsValidator struct {
Count int
}
HasDocumentsValidator validate whether the count of manifests rendered form template is Count
func (HasDocumentsValidator) Validate ¶
func (v HasDocumentsValidator) Validate(context *ValidateContext) (bool, []string)
Validate implement Validatable
type IsAPIVersionValidator ¶
type IsAPIVersionValidator struct {
Of string
}
IsAPIVersionValidator validate apiVersion of manifest is Of
func (IsAPIVersionValidator) Validate ¶
func (v IsAPIVersionValidator) Validate(context *ValidateContext) (bool, []string)
Validate implement Validatable
type IsKindValidator ¶
type IsKindValidator struct {
Of string
}
IsKindValidator validate kind of manifest is Of
func (IsKindValidator) Validate ¶
func (v IsKindValidator) Validate(context *ValidateContext) (bool, []string)
Validate implement Validatable
type IsNullOrEmptyValidator ¶ added in v0.3.2
type IsNullOrEmptyValidator struct {
Path string
}
IsNullOrEmptyValidator validate value of Path is empty
func (IsNullOrEmptyValidator) Validate ¶ added in v0.3.2
func (v IsNullOrEmptyValidator) Validate(context *ValidateContext) (bool, []string)
Validate implement Validatable
type IsSubsetValidator ¶
type IsSubsetValidator struct { Path string Content interface{} }
IsSubsetValidator validate whether value of Path contains Content
func (IsSubsetValidator) Validate ¶
func (v IsSubsetValidator) Validate(context *ValidateContext) (bool, []string)
Validate implement Validatable
type LengthEqualDocumentsValidator ¶
type LengthEqualDocumentsValidator struct { Paths []string // optional Path string // optional Count int // optional if paths defined }
LengthEqualDocumentsValidator validate whether the count of manifests rendered form template is Count
func (LengthEqualDocumentsValidator) Validate ¶
func (v LengthEqualDocumentsValidator) Validate(context *ValidateContext) (bool, []string)
Validate implement Validatable
type MatchRegexRawValidator ¶
type MatchRegexRawValidator struct {
Pattern string
}
MatchRegexRawValidator validate value of Path match Pattern
func (MatchRegexRawValidator) Validate ¶
func (v MatchRegexRawValidator) Validate(context *ValidateContext) (bool, []string)
Validate implement Validatable
type MatchRegexValidator ¶
MatchRegexValidator validate value of Path match Pattern
func (MatchRegexValidator) Validate ¶
func (v MatchRegexValidator) Validate(context *ValidateContext) (bool, []string)
Validate implement Validatable
type MatchSnapshotRawValidator ¶
type MatchSnapshotRawValidator struct{}
MatchSnapshotRawValidator validate snapshot of value of Path the same as cached
func (MatchSnapshotRawValidator) Validate ¶
func (v MatchSnapshotRawValidator) Validate(context *ValidateContext) (bool, []string)
Validate implement Validatable
type MatchSnapshotValidator ¶
type MatchSnapshotValidator struct {
Path string
}
MatchSnapshotValidator validate snapshot of value of Path the same as cached
func (MatchSnapshotValidator) Validate ¶
func (v MatchSnapshotValidator) Validate(context *ValidateContext) (bool, []string)
Validate implement Validatable
type SnapshotComparer ¶
type SnapshotComparer interface {
CompareToSnapshot(content interface{}) *snapshot.CompareResult
}
SnapshotComparer provide CompareToSnapshot utility to validator
type Validatable ¶
type Validatable interface {
Validate(context *ValidateContext) (bool, []string)
}
Validatable all validators must implement Validate method
type ValidateContext ¶
type ValidateContext struct { Docs []common.K8sManifest Index int Negative bool SnapshotComparer RenderError error }
ValidateContext the context passed to validators
Source Files ¶
- common.go
- contains_document_validator.go
- contains_validator.go
- equal_raw_validator.go
- equal_validator.go
- exists_validator.go
- failed_template_validator.go
- has_document_validator.go
- is_apiversion_validator.go
- is_kind_validator.go
- is_nullorempty_validator.go
- is_subset_validator.go
- length_equal_document_validator.go
- match_regex_raw_validator.go
- match_regex_validator.go
- snapshot_raw_validator.go
- snapshot_validator.go