rules

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 25, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const BilingualRuleName = "bilingual"
View Source
const CRDsRuleName = "deckhouse-crds"
View Source
const CrdsDir = "crds"
View Source
const DeckhouseValidationsRuleName = "deckhouse-validations"
View Source
const DocRuYAMLRuleName = "doc-ru-yaml"
View Source
const EnumRuleName = "enum"
View Source
const HARuleName = "high-availability"
View Source
const KeysRuleName = "keys"

Variables

This section is empty.

Functions

This section is empty.

Types

type BilingualRule added in v0.1.71

type BilingualRule struct {
	pkg.RuleMeta
	// contains filtered or unexported fields
}

func NewBilingualRule added in v0.1.71

func NewBilingualRule(_ *pkg.OpenAPILinterConfig,
	m pkg.Module, errorList *errors.LintRuleErrorsList) *BilingualRule

func (*BilingualRule) Check added in v0.2.0

func (r *BilingualRule) Check(_ context.Context)

type DeckhouseCRDsRule

type DeckhouseCRDsRule struct {
	pkg.RuleMeta
	pkg.StringRule
	// contains filtered or unexported fields
}

func NewDeckhouseCRDsRule

func NewDeckhouseCRDsRule(cfg *pkg.OpenAPILinterConfig,
	m pkg.Module, errorList *errors.LintRuleErrorsList) *DeckhouseCRDsRule

func (*DeckhouseCRDsRule) Check added in v0.2.0

func (r *DeckhouseCRDsRule) Check(_ context.Context)

type DeckhouseValidationsRule added in v0.2.0

type DeckhouseValidationsRule struct {
	pkg.RuleMeta
	// contains filtered or unexported fields
}

DeckhouseValidationsRule validates the Deckhouse/Kubernetes CEL-validation extensions inside a module's openapi/ schemas.

Rationale: x-deckhouse-validations is consumed only by deckhouse-controller at module-config validation time (see deckhouse/deckhouse deckhouse-controller/internal/packages/values/schema/cel). A malformed block — not a list, an entry missing expression/message, or an expression that is not a valid CEL program — is therefore never caught by the other openapi rules and only surfaces at runtime, when the module config is applied on a cluster. This rule shifts that detection left, checking the same invariants the controller enforces, so a broken block is reported in the module's own CI with its path.

It reports two things over every openapi/ schema:

  • x-deckhouse-validations blocks whose shape does not match what the controller accepts (list of non-empty {expression, message} mappings), and expressions that do not compile as CEL over self/oldSelf.
  • x-kubernetes-validations keys, which look right but are ignored here: the controller honors x-deckhouse-validations, so this is almost always a mix-up.

Every finding is currently emitted at warn level; the structural/CEL checks are intended to become errors once modules have migrated.

func NewDeckhouseValidationsRule added in v0.2.0

func NewDeckhouseValidationsRule(_ *pkg.OpenAPILinterConfig,
	m pkg.Module, errorList *errors.LintRuleErrorsList) *DeckhouseValidationsRule

func (*DeckhouseValidationsRule) Check added in v0.2.0

Check walks the openapi/ schemas only. crds/ is deliberately out of scope: there x-kubernetes-validations is honored by the API server, so flagging it would be a false positive.

type DocRuYAMLRule added in v0.1.105

type DocRuYAMLRule struct {
	pkg.RuleMeta
	// contains filtered or unexported fields
}

func NewDocRuYAMLRule added in v0.1.105

func NewDocRuYAMLRule(_ *pkg.OpenAPILinterConfig,
	m pkg.Module, errorList *errors.LintRuleErrorsList) *DocRuYAMLRule

func (*DocRuYAMLRule) Check added in v0.2.0

func (r *DocRuYAMLRule) Check(_ context.Context)

type EnumRule

type EnumRule struct {
	pkg.RuleMeta
	// contains filtered or unexported fields
}

func NewEnumRule

func NewEnumRule(cfg *pkg.OpenAPILinterConfig,
	m pkg.Module, errorList *errors.LintRuleErrorsList) *EnumRule

func (*EnumRule) Check added in v0.2.0

func (r *EnumRule) Check(_ context.Context)

type HARule

type HARule struct {
	pkg.RuleMeta
	pkg.StringRule
	// contains filtered or unexported fields
}

func NewHARule

func NewHARule(cfg *pkg.OpenAPILinterConfig,
	m pkg.Module, errorList *errors.LintRuleErrorsList) *HARule

func (*HARule) Check added in v0.2.0

func (r *HARule) Check(_ context.Context)

type KeysRule

type KeysRule struct {
	pkg.RuleMeta
	// contains filtered or unexported fields
}

func NewKeysRule

func NewKeysRule(cfg *pkg.OpenAPILinterConfig,
	m pkg.Module, errorList *errors.LintRuleErrorsList) *KeysRule

func (*KeysRule) Check added in v0.2.0

func (r *KeysRule) Check(_ context.Context)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL