Documentation ¶
Index ¶
- Constants
- func LogViolations(ctx context.Context, violations []common.Violation, ...) error
- type K8SProvider
- type Validation
- func (v *Validation) SetAbortFunc(abortFunc common.AbortFunc)
- func (v *Validation) SetAppFileSystem(appFs afero.Fs)
- func (v *Validation) SetClient(client *K8SProvider)
- func (v *Validation) SetContext(context context.Context)
- func (v *Validation) SetLogger(logger logr.Logger)
- func (v *Validation) Validate(validators []common.Validator) ([]common.Violation, error)
Constants ¶
View Source
const LOGGER_NAME string = "k8s-resource-validator"
Variables ¶
This section is empty.
Functions ¶
func LogViolations ¶ added in v0.1.1
func LogViolations(ctx context.Context, violations []common.Violation, thresholdLevelForErrors int) error
LogViolations() writes violations to a logger. It is a convenience method. You may choose to write violations to the log in a different format.
ctx is expected to contain the logger
thresholdLevelForErrors specifies that violations of this level or below are considered errors; others are info
Types ¶
type K8SProvider ¶
type K8SProvider struct { Dynamic dynamic.Interface ClientSet kubernetes.Interface }
type Validation ¶
type Validation struct { Client *K8SProvider Resources []unstructured.Unstructured AbortValidationConfigMapField string AbortValidationConfigMapName string AbortValidationConfigMapNamespace string PreValidated bool // contains filtered or unexported fields }
func NewValidation ¶
func NewValidation(ctx context.Context) (*Validation, error)
func (*Validation) SetAbortFunc ¶
func (v *Validation) SetAbortFunc(abortFunc common.AbortFunc)
func (*Validation) SetAppFileSystem ¶ added in v0.2.1
func (v *Validation) SetAppFileSystem(appFs afero.Fs)
func (*Validation) SetClient ¶
func (v *Validation) SetClient(client *K8SProvider)
func (*Validation) SetContext ¶ added in v0.2.1
func (v *Validation) SetContext(context context.Context)
If this function is not called, a new client will be created in preValidate()
func (*Validation) SetLogger ¶ added in v0.2.1
func (v *Validation) SetLogger(logger logr.Logger)
Click to show internal directories.
Click to hide internal directories.