Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GVKDoc ¶
type GVKDoc struct {
Kind string `yaml:"kind" json:"kind" validate:"required"`
APIVersion string `yaml:"apiVersion" json:"apiVersion"`
Metadata GVKMetadata `yaml:"metadata" json:"metadata"`
}
GVKDoc represents a Kubernetes resource with basic GVK info
type GVKMetadata ¶
type GVKMetadata struct {
Name string `yaml:"name" json:"name"`
Namespace string `yaml:"namespace" json:"namespace"`
}
GVKMetadata represents basic metadata for a Kubernetes resource
type LintExpression ¶
type LintExpression struct {
Rule string `json:"rule"`
Type string `json:"type"` // "error", "warn", "info"
Message string `json:"message"`
Path string `json:"path"`
Positions []LintExpressionItemPosition `json:"positions"`
}
LintExpression represents a single lint finding
type LintExpressionItemLinePosition ¶
type LintExpressionItemLinePosition struct {
Line int `json:"line"`
}
LintExpressionItemLinePosition represents a line position
type LintExpressionItemPosition ¶
type LintExpressionItemPosition struct {
Start LintExpressionItemLinePosition `json:"start"`
}
LintExpressionItemPosition represents the position of a lint finding in a file
type LintExpressionsByRule ¶
type LintExpressionsByRule []LintExpression
LintExpressionsByRule implements sort.Interface for []LintExpression based on Rule field
func (LintExpressionsByRule) Len ¶
func (a LintExpressionsByRule) Len() int
func (LintExpressionsByRule) Less ¶
func (a LintExpressionsByRule) Less(i, j int) bool
func (LintExpressionsByRule) Swap ¶
func (a LintExpressionsByRule) Swap(i, j int)
type LintResult ¶
type LintResult struct {
LintExpressions []LintExpression `json:"lintExpressions"`
IsComplete bool `json:"isLintingComplete"`
}
LintResult represents the complete result of linting
func (*LintResult) ErrorCount ¶
func (r *LintResult) ErrorCount() int
ErrorCount returns the number of errors
func (*LintResult) HasErrors ¶
func (r *LintResult) HasErrors() bool
HasErrors returns true if the result contains any errors
func (*LintResult) HasWarnings ¶
func (r *LintResult) HasWarnings() bool
HasWarnings returns true if the result contains any warnings
func (*LintResult) WarningCount ¶
func (r *LintResult) WarningCount() int
WarningCount returns the number of warnings
type OPALintExpression ¶
type OPALintExpression struct {
Rule string `json:"rule"`
Type string `json:"type"`
Message string `json:"message"`
Path string `json:"path"`
DocIndex int `json:"docIndex"`
Field string `json:"field"`
Match string `json:"match"`
}
OPALintExpression represents a lint expression from OPA policy evaluation
type SpecFile ¶
type SpecFile struct {
Name string `json:"name"`
Path string `json:"path"`
Content string `json:"content"`
DocIndex int `json:"docIndex,omitempty"`
AllowDuplicates bool `json:"allowDuplicates"` // kotskinds can be duplicated if they are coming from secrets or configmaps
Children SpecFiles `json:"children"`
}
SpecFile represents a single file in a KOTS application
type SpecFiles ¶
type SpecFiles []SpecFile
SpecFiles is a collection of SpecFile
func SpecFilesFromTar ¶
SpecFilesFromTar loads spec files from a tar archive
func SpecFilesFromTarGz ¶
SpecFilesFromTarGz loads spec files from a .tgz archive