pkg

package
v0.1.64 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var IgnoreDeckhouseReposList = []string{"deckhouse", "deckhouse-test-1", "deckhouse-test-2"}

TODO: THINK ABOUT HOW TO ENDURE

Functions

This section is empty.

Types

type BoolRule

type BoolRule struct {
	Exclude bool
}

func (*BoolRule) Enabled

func (r *BoolRule) Enabled() bool

type ContainerExcludeRules added in v0.1.36

type ContainerExcludeRules struct {
	ControllerSecurityContext KindRuleExcludeList
	DNSPolicy                 KindRuleExcludeList

	HostNetworkPorts       ContainerRuleExcludeList
	Ports                  ContainerRuleExcludeList
	ReadOnlyRootFilesystem ContainerRuleExcludeList
	NoNewPrivileges        ContainerRuleExcludeList
	SeccompProfile         ContainerRuleExcludeList
	ImageDigest            ContainerRuleExcludeList
	Resources              ContainerRuleExcludeList
	SecurityContext        ContainerRuleExcludeList
	Liveness               ContainerRuleExcludeList
	Readiness              ContainerRuleExcludeList

	Description StringRuleExcludeList
}

type ContainerLinterConfig added in v0.1.36

type ContainerLinterConfig struct {
	LinterConfig
	Rules        ContainerLinterRules
	ExcludeRules ContainerExcludeRules
}

type ContainerLinterRules added in v0.1.36

type ContainerLinterRules struct {
	RecommendedLabelsRule         RuleConfig
	NamespaceLabelsRule           RuleConfig
	ApiVersionRule                RuleConfig
	PriorityClassRule             RuleConfig
	DNSPolicyRule                 RuleConfig
	ControllerSecurityContextRule RuleConfig
	NewRevisionHistoryLimitRule   RuleConfig

	// Container-specific rules
	NameDuplicatesRule           RuleConfig
	ReadOnlyRootFilesystemRule   RuleConfig
	NoNewPrivilegesRule          RuleConfig
	SeccompProfileRule           RuleConfig
	HostNetworkPortsRule         RuleConfig
	EnvVariablesDuplicatesRule   RuleConfig
	ImageDigestRule              RuleConfig
	ImagePullPolicyRule          RuleConfig
	ResourcesRule                RuleConfig
	ContainerSecurityContextRule RuleConfig
	PortsRule                    RuleConfig
	LivenessRule                 RuleConfig
	ReadinessRule                RuleConfig
}

type ContainerRule

type ContainerRule struct {
	ExcludeRules []ContainerRuleExclude
}

func (*ContainerRule) Enabled

func (r *ContainerRule) Enabled(object storage.StoreObject, container *corev1.Container) bool

type ContainerRuleExclude

type ContainerRuleExclude struct {
	Kind      string
	Name      string
	Container string
}

func (*ContainerRuleExclude) Enabled

func (e *ContainerRuleExclude) Enabled(object storage.StoreObject, container *corev1.Container) bool

type ContainerRuleExcludeList added in v0.1.36

type ContainerRuleExcludeList []ContainerRuleExclude

ContainerRuleExcludeList represents a list of container exclusions

func (ContainerRuleExcludeList) Get added in v0.1.36

type ConversionsRuleSettings added in v0.1.36

type ConversionsRuleSettings struct {
	Disable bool
}

type DefinitionFileRuleSettings added in v0.1.36

type DefinitionFileRuleSettings struct {
	Disable bool
}

type DocumentationLinterConfig added in v0.1.37

type DocumentationLinterConfig struct {
	LinterConfig
	Rules DocumentationLinterRules
}

type DocumentationLinterRules added in v0.1.37

type DocumentationLinterRules struct {
	ReadmeRule            RuleConfig
	BilingualRule         RuleConfig
	CyrillicInEnglishRule RuleConfig
}

type GrafanaDashboardsSettings added in v0.1.36

type GrafanaDashboardsSettings struct {
	Disable bool
}

type HelmignoreRuleSettings added in v0.1.36

type HelmignoreRuleSettings struct {
	Disable bool
}

type HooksLinterConfig added in v0.1.36

type HooksLinterConfig struct {
	LinterConfig
	Rules               HooksLinterRules
	IngressRuleSettings IngressRuleSettings
}

type HooksLinterRules added in v0.1.36

type HooksLinterRules struct {
	HooksRule RuleConfig
}

type ImageExcludeRules added in v0.1.36

type ImageExcludeRules struct {
	SkipImageFilePathPrefix      PrefixRuleExcludeList
	SkipDistrolessFilePathPrefix PrefixRuleExcludeList
}

type ImageLinterConfig added in v0.1.36

type ImageLinterConfig struct {
	LinterConfig
	Rules        ImageLinterRules
	ExcludeRules ImageExcludeRules
	Patches      PatchesRuleSettings
	Werf         WerfRuleSettings
}

type ImageLinterRules added in v0.1.36

type ImageLinterRules struct {
	DistrolessRule RuleConfig
	ImageRule      RuleConfig
	PatchesRule    RuleConfig
	WerfRule       RuleConfig
}

type IngressRuleSettings added in v0.1.36

type IngressRuleSettings struct {
	Disable bool
}

type KindRule

type KindRule struct {
	ExcludeRules []KindRuleExclude
}

func (*KindRule) Enabled

func (r *KindRule) Enabled(kind, name string) bool

type KindRuleExclude

type KindRuleExclude struct {
	Kind string
	Name string
}

func (*KindRuleExclude) Enabled

func (e *KindRuleExclude) Enabled(kind, name string) bool

type KindRuleExcludeList added in v0.1.36

type KindRuleExcludeList []KindRuleExclude

func (KindRuleExcludeList) Get added in v0.1.36

type Level

type Level int
const (
	Ignored Level = iota
	Warn
	Error
	Critical
)

func ParseStringToLevel

func ParseStringToLevel(str string) Level

func (Level) String added in v0.1.10

func (l Level) String() string

type LicenseExcludeRule added in v0.1.36

type LicenseExcludeRule struct {
	Files       StringRuleExcludeList `mapstructure:"files"`
	Directories PrefixRuleExcludeList `mapstructure:"directories"`
}

type LinterConfig added in v0.1.36

type LinterConfig struct {
	Impact *Level
}

func (*LinterConfig) SetLevel added in v0.1.36

func (rc *LinterConfig) SetLevel(level string)

type LinterError

type LinterError struct {
	LinterID    string
	ModuleID    string
	RuleID      string
	ObjectID    string
	ObjectValue any
	Text        string
	FilePath    string
	LineNumber  int
	Level       Level
}

type LintersSettings added in v0.1.36

type LintersSettings struct {
	Container     ContainerLinterConfig
	Image         ImageLinterConfig
	NoCyrillic    NoCyrillicLinterConfig
	OpenAPI       OpenAPILinterConfig
	Templates     TemplatesLinterConfig
	RBAC          RBACLinterConfig
	Hooks         HooksLinterConfig
	Module        ModuleLinterConfig
	Documentation DocumentationLinterConfig
}

type Module added in v0.1.37

type Module interface {
	// GetName returns the name of the module
	GetName() string

	// GetNamespace returns the namespace where the module should be deployed
	GetNamespace() string

	// GetPath returns the filesystem path to the module directory
	GetPath() string

	// GetWerfFile returns the content of the werf.yaml file
	GetWerfFile() string

	// GetChart returns the Helm chart associated with the module
	GetChart() *chart.Chart

	// GetObjectStore returns the unstructured object store containing parsed Kubernetes resources
	GetObjectStore() *storage.UnstructuredObjectStore

	// GetStorage returns a map of all parsed Kubernetes resources indexed by ResourceIndex
	GetStorage() map[storage.ResourceIndex]storage.StoreObject
}

Module represents a DMT module interface that provides access to module metadata and resources. This interface is used by linters to access only the necessary module information, following the Interface Segregation Principle.

type ModuleExcludeRules added in v0.1.36

type ModuleExcludeRules struct {
	License LicenseExcludeRule
}

type ModuleLinterConfig added in v0.1.36

type ModuleLinterConfig struct {
	LinterConfig
	Rules                      ModuleLinterRules
	OSSRuleSettings            OSSRuleSettings
	DefinitionFileRuleSettings DefinitionFileRuleSettings
	ConversionsRuleSettings    ConversionsRuleSettings
	HelmignoreRuleSettings     HelmignoreRuleSettings
	ExcludeRules               ModuleExcludeRules
}

type ModuleLinterRules added in v0.1.36

type ModuleLinterRules struct {
	DefinitionFileRule    RuleConfig
	OSSRule               RuleConfig
	ConversionRule        RuleConfig
	HelmignoreRule        RuleConfig
	LicenseRule           RuleConfig
	RequarementsRule      RuleConfig
	LegacyReleaseFileRule RuleConfig
}

type NoCyrillicExcludeRules added in v0.1.36

type NoCyrillicExcludeRules struct {
	Files       StringRuleExcludeList
	Directories PrefixRuleExcludeList
}

type NoCyrillicLinterConfig added in v0.1.36

type NoCyrillicLinterConfig struct {
	LinterConfig
	Rules        NoCyrillicLinterRules
	ExcludeRules NoCyrillicExcludeRules
}

type NoCyrillicLinterRules added in v0.1.36

type NoCyrillicLinterRules struct {
	NoCyrillicRule RuleConfig
}

type OSSRuleSettings added in v0.1.36

type OSSRuleSettings struct {
	Disable bool
}

type OpenAPIExcludeRules added in v0.1.36

type OpenAPIExcludeRules struct {
	KeyBannedNames         []string
	EnumFileExcludes       []string
	HAAbsoluteKeysExcludes StringRuleExcludeList
	CRDNamesExcludes       StringRuleExcludeList
}

type OpenAPILinterConfig added in v0.1.36

type OpenAPILinterConfig struct {
	LinterConfig
	Rules        OpenAPILinterRules
	ExcludeRules OpenAPIExcludeRules
}

type OpenAPILinterRules added in v0.1.36

type OpenAPILinterRules struct {
	EnumRule RuleConfig
	HARule   RuleConfig
	CRDsRule RuleConfig
	KeysRule RuleConfig
}

type PatchesRuleSettings added in v0.1.36

type PatchesRuleSettings struct {
	Disable bool
}

type PathRule added in v0.1.3

type PathRule struct {
	ExcludeStringRules []StringRuleExclude
	ExcludePrefixRules []PrefixRuleExclude
}

func (*PathRule) Enabled added in v0.1.3

func (r *PathRule) Enabled(name string) bool

type PrefixRule added in v0.1.3

type PrefixRule struct {
	ExcludeRules []PrefixRuleExclude
}

func (*PrefixRule) Enabled added in v0.1.3

func (r *PrefixRule) Enabled(str string) bool

type PrefixRuleExclude added in v0.1.3

type PrefixRuleExclude string

func (PrefixRuleExclude) Enabled added in v0.1.3

func (e PrefixRuleExclude) Enabled(str string) bool

type PrefixRuleExcludeList added in v0.1.36

type PrefixRuleExcludeList []string

func (PrefixRuleExcludeList) Get added in v0.1.36

type PrometheusRuleSettings added in v0.1.36

type PrometheusRuleSettings struct {
	Disable bool
}

type RBACExcludeRules added in v0.1.36

type RBACExcludeRules struct {
	BindingSubject StringRuleExcludeList
	Placement      KindRuleExcludeList
	Wildcards      KindRuleExcludeList
}

type RBACLinterConfig added in v0.1.36

type RBACLinterConfig struct {
	LinterConfig
	Rules        RBACLinterRules
	ExcludeRules RBACExcludeRules
}

type RBACLinterRules added in v0.1.36

type RBACLinterRules struct {
	UserAuthRule  RuleConfig
	BindingRule   RuleConfig
	PlacementRule RuleConfig
	WildcardsRule RuleConfig
}

type RuleConfig added in v0.1.36

type RuleConfig struct {
	// contains filtered or unexported fields
}

func (*RuleConfig) GetLevel added in v0.1.36

func (rc *RuleConfig) GetLevel() *Level

func (*RuleConfig) SetLevel added in v0.1.36

func (rc *RuleConfig) SetLevel(level, backoff string)

func (*RuleConfig) SetStringLevel added in v0.1.36

func (rc *RuleConfig) SetStringLevel(current, backoff string)

type RuleMeta

type RuleMeta struct {
	Name string
}

func (*RuleMeta) GetName

func (m *RuleMeta) GetName() string

type ServicePortExclude

type ServicePortExclude struct {
	Name string
	Port string
}

func (*ServicePortExclude) Enabled

func (e *ServicePortExclude) Enabled(name, port string) bool

type ServicePortExcludeList added in v0.1.36

type ServicePortExcludeList []ServicePortExclude

func (ServicePortExcludeList) Get added in v0.1.36

type ServicePortRule

type ServicePortRule struct {
	ExcludeRules []ServicePortExclude
}

func (*ServicePortRule) Enabled

func (r *ServicePortRule) Enabled(name, port string) bool

type StringRule

type StringRule struct {
	ExcludeRules []StringRuleExclude
}

func (*StringRule) Enabled

func (r *StringRule) Enabled(str string) bool

type StringRuleExclude

type StringRuleExclude string

func (StringRuleExclude) Enabled

func (e StringRuleExclude) Enabled(str string) bool

type StringRuleExcludeList added in v0.1.36

type StringRuleExcludeList []string

func (StringRuleExcludeList) Get added in v0.1.36

type TemplatesExcludeRules added in v0.1.36

type TemplatesExcludeRules struct {
	VPAAbsent     KindRuleExcludeList
	PDBAbsent     KindRuleExcludeList
	ServicePort   ServicePortExcludeList
	KubeRBACProxy StringRuleExcludeList
	Ingress       KindRuleExcludeList
}

type TemplatesLinterConfig added in v0.1.36

type TemplatesLinterConfig struct {
	LinterConfig
	Rules                     TemplatesLinterRules
	ExcludeRules              TemplatesExcludeRules
	PrometheusRuleSettings    PrometheusRuleSettings
	GrafanaDashboardsSettings GrafanaDashboardsSettings
}

type TemplatesLinterRules added in v0.1.36

type TemplatesLinterRules struct {
	VPARule           RuleConfig
	PDBRule           RuleConfig
	IngressRule       RuleConfig
	PrometheusRule    RuleConfig
	GrafanaRule       RuleConfig
	KubeRBACProxyRule RuleConfig
	ServicePortRule   RuleConfig
	ClusterDomainRule RuleConfig
	RegistryRule      RuleConfig
}

type WerfRuleSettings added in v0.1.36

type WerfRuleSettings struct {
	Disable bool
}

Jump to

Keyboard shortcuts

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