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 ¶
Package lint contains functions for verifying zarf yaml files are valid
Index ¶
- Variables
- func GroupFindingsByPath(findings []PackageFinding, packageName string) map[string][]PackageFinding
- func HasSevOrHigher(findings []PackageFinding, severity Severity) bool
- func PrintFindings(findings []PackageFinding, severity Severity, baseDir string, ...)
- func Validate(ctx context.Context, createOpts types.ZarfCreateOptions) error
- type PackageFinding
- type Severity
Constants ¶
This section is empty.
Variables ¶
var ZarfSchema fs.ReadFileFS
ZarfSchema is exported so main.go can embed the schema file
Functions ¶
func GroupFindingsByPath ¶
func GroupFindingsByPath(findings []PackageFinding, packageName string) map[string][]PackageFinding
GroupFindingsByPath groups findings by their package path
func HasSevOrHigher ¶
func HasSevOrHigher(findings []PackageFinding, severity Severity) bool
HasSevOrHigher returns true if the findings contain a severity equal to or greater than the given severity
func PrintFindings ¶
func PrintFindings(findings []PackageFinding, severity Severity, baseDir string, packageName string)
PrintFindings prints the findings of the given severity in a table
Types ¶
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 // PackageNameOverride shows the name of the package that the error originated from // If it is not set the base package will be used when displaying the error PackageNameOverride string // PackagePathOverride shows the path to the package that the error originated from // If it is not set the base package will be used when displaying the error PackagePathOverride string Severity Severity }
PackageFinding is a struct that contains a finding about something wrong with a package
func CheckComponentValues ¶
func CheckComponentValues(c types.ZarfComponent, i int) []PackageFinding
CheckComponentValues runs lint rules validating values on component keys, should be run after templating
func ValidatePackageSchema ¶
func ValidatePackageSchema() ([]PackageFinding, error)
ValidatePackageSchema checks the Zarf package in the current directory against the Zarf schema