Documentation
¶
Index ¶
Constants ¶
const BilingualRuleName = "bilingual"
const CRDsRuleName = "deckhouse-crds"
const CrdsDir = "crds"
const DeckhouseValidationsRuleName = "deckhouse-validations"
const DocRuYAMLRuleName = "doc-ru-yaml"
const EnumRuleName = "enum"
const HARuleName = "high-availability"
const KeysRuleName = "keys"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BilingualRule ¶ added in v0.1.71
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
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
func (r *DeckhouseValidationsRule) Check(_ context.Context)
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
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 ¶
func NewEnumRule ¶
func NewEnumRule(cfg *pkg.OpenAPILinterConfig, m pkg.Module, errorList *errors.LintRuleErrorsList) *EnumRule
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
type KeysRule ¶
func NewKeysRule ¶
func NewKeysRule(cfg *pkg.OpenAPILinterConfig, m pkg.Module, errorList *errors.LintRuleErrorsList) *KeysRule