Documentation
¶
Overview ¶
Package lint contains functions for verifying zarf yaml files are valid
Package lint contains functions for verifying zarf yaml files are valid ¶
Package lint contains functions for verifying zarf yaml files are valid
Index ¶
- Constants
- type LintError
- type PackageFinding
- func CheckComponentValues(c v1alpha1.ZarfComponent, i int) []PackageFindingdeprecated
- func CheckComponentValuesV1Beta1(c v1beta1.ComponentSpec, path string) []PackageFinding
- func ValidateComponentConfigSchemaBytesV1Beta1(b []byte) ([]PackageFinding, error)
- func ValidatePackageSchemaBytesV1Beta1(b []byte) ([]PackageFinding, error)
- func ValidatePackageSchemaV1Alpha1(pkg any, setVariables map[string]string) ([]PackageFinding, error)deprecated
- func ValidatePackageSchemaV1Beta1(pkg any) ([]PackageFinding, error)
- type Severity
Constants ¶
const ( SevErr = "Error" SevWarn = "Warning" )
Severity definitions.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LintError ¶ added in v0.39.0
type LintError struct {
PackageName string
Findings []PackageFinding
}
LintError represents an error containing lint findings.
func (*LintError) OnlyWarnings ¶ added in v0.39.0
OnlyWarnings returns true if all findings have severity warning.
type PackageFinding ¶
type PackageFinding struct {
// YqPath is the path to the key where the error originated from, this is sometimes empty in the case of a general error
YqPath string
Description string
// Item is the value of a key that is causing an error, for example a bad image name
Item string
// Severity of finding.
Severity Severity
}
PackageFinding is a struct that contains a finding about something wrong with a package
func CheckComponentValues
deprecated
func CheckComponentValues(c v1alpha1.ZarfComponent, i int) []PackageFinding
CheckComponentValues runs lint rules validating values on component keys, should be run after templating
Deprecated: Only supported by deprecated v1alpha1 packages.
func CheckComponentValuesV1Beta1 ¶ added in v0.88.0
func CheckComponentValuesV1Beta1(c v1beta1.ComponentSpec, path string) []PackageFinding
CheckComponentValuesV1Beta1 checks recommended practices on a resolved v1beta1 component. path is the component's location in the source definition.
func ValidateComponentConfigSchemaBytesV1Beta1 ¶ added in v0.84.0
func ValidateComponentConfigSchemaBytesV1Beta1(b []byte) ([]PackageFinding, error)
ValidateComponentConfigSchemaBytesV1Beta1 checks a v1beta1 Zarf component config against the v1beta1 component schema.
func ValidatePackageSchemaBytesV1Beta1 ¶ added in v0.84.0
func ValidatePackageSchemaBytesV1Beta1(b []byte) ([]PackageFinding, error)
ValidatePackageSchemaBytesV1Beta1 checks v1beta1 Zarf package bytes against the v1beta1 package schema.
func ValidatePackageSchemaV1Alpha1
deprecated
added in
v0.88.0
func ValidatePackageSchemaV1Alpha1(pkg any, setVariables map[string]string) ([]PackageFinding, error)
ValidatePackageSchemaV1Alpha1 validates a package's fields against the v1alpha1 schema. Use an untyped value to retain unknown fields for validation.
Deprecated: Only supported by deprecated v1alpha1 packages.
func ValidatePackageSchemaV1Beta1 ¶ added in v0.88.0
func ValidatePackageSchemaV1Beta1(pkg any) ([]PackageFinding, error)
ValidatePackageSchemaV1Beta1 validates a package's fields against the v1beta1 schema. Use an untyped value to retain unknown fields for validation.
func (PackageFinding) ItemizedDescription ¶ added in v0.39.0
func (f PackageFinding) ItemizedDescription() string
ItemizedDescription returns a string with the description and item if finding contains one.