Documentation
¶
Index ¶
- func Lint(t T, args ...Option)
- type Option
- func WithChartDir(dir string) Option
- func WithFixturesDir(dir string) Option
- func WithMaxConcurrency(n int) Option
- func WithPoliciesDir(dir string) Option
- func WithPreserve() Option
- func WithRecursion(fn RecursionFn, opts ...Option) Option
- func WithVisitor(fn VisitorFn) Option
- func WithWriteExceptions() Option
- type RecursionFn
- type T
- type VisitorFn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Option ¶
type Option func(*options)
func WithChartDir ¶
WithChartDir sets the directory of the chart to be tested. Defaults to the current directory.
func WithFixturesDir ¶
WithFixturesDir overrides the default fixtures directory, which is "fixtures" in the chart directory. Multiple fixtures directores are supported.
func WithMaxConcurrency ¶
WithMaxConcurrency sets the maximum number of concurrent goroutines used by the linters. Defaults to 2 * runtime.NumCPU().
func WithPoliciesDir ¶
WithPolicyDir overrides the default policies directory, which is "policies" in the chart directory.
func WithPreserve ¶
func WithPreserve() Option
WithPreserve causes the temporary directory to be logged after the test instead of being deleted. Useful for debugging.
func WithRecursion ¶
func WithRecursion(fn RecursionFn, opts ...Option) Option
WithRecursion provides a hook for extracting a k8s manifest to be linted out of another resource. For example: if a chart renders some resources into a configmap, this hook can be used to lint the "nested" resources. Multiple recursions are allowed. Only the WithPolicyDir option is supported.
func WithVisitor ¶
WithVisitor is called for every fixture and given the path of the rendered chart directory. Multiple visitors are allowed. Might be called concurrently!
func WithWriteExceptions ¶
func WithWriteExceptions() Option
WithWriteExceptions causes the linter to update the chart to ignore conditional branches that are not currently covered by the given fixtures.
Disabled by default. Can also be enabled by setting HELMLINT_WRITE_EXCEPTIONS=true.
type RecursionFn ¶
func RecurseConfigmap ¶
func RecurseConfigmap(manifestPath string) RecursionFn
RecurseConfigmap recurses into resource manifests stored in each key of a ConfigMap at the given file path relative to the chart output.