Documentation
¶
Index ¶
- func IsBoolSet(s *bool) bool
- func IsStrSet(s *string) bool
- func SanitizeFileName(name string) string
- type AllocationLimits
- type Allocations
- type BasicAuth
- type Config
- func (c *Config) AllowedRegistries() []string
- func (c *Config) CPUResourceLimits() Allocations
- func (c *Config) ExcludeContainer(gvr types.GVR, fqn, co string) bool
- func (c *Config) ExcludeFQN(gvr types.GVR, fqn string, cos []string) bool
- func (c *Config) MEMResourceLimits() Allocations
- func (c *Config) Match(s rules.Spec) bool
- func (c *Config) NodeCPULimit() float64
- func (c *Config) NodeMEMLimit() float64
- func (c *Config) PodCPULimit() float64
- func (c *Config) PodMEMLimit() float64
- func (c *Config) RestartsLimit() int
- func (c *Config) Sections() []string
- type Flags
- type Limits
- type Node
- type Pod
- type Popeye
- type PushGateway
- type Resources
- type S3Info
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsStrSet ¶ added in v0.20.0
func IsStrSet(s *string) bool
IsStrSet checks string option is set.
func SanitizeFileName ¶ added in v0.20.0
func SanitizeFileName(name string) string
SanitizeFileName ensure file spec is valid.
Types ¶
type AllocationLimits ¶ added in v0.3.0
type AllocationLimits struct {
CPU Allocations `yaml:"cpu"`
MEM Allocations `yaml:"memory"`
}
AllocationLimits tracks limit thresholds cpu and memory thresholds.
type Allocations ¶ added in v0.3.0
type Allocations struct {
UnderPerc int `yaml:"underPercUtilization"`
OverPerc int `yanl:"overPercUtilization"`
}
Allocations track under/over allocation limits.
type BasicAuth ¶ added in v0.9.1
type BasicAuth struct {
User *string
Password *string
}
BasicAuth tracks basic authentication.
type Config ¶
type Config struct {
Popeye `yaml:"popeye"`
Flags *Flags
LintLevel int
}
Config tracks Popeye configuration options.
func NewConfig ¶ added in v0.2.0
func NewConfig(flags *Flags) (*Config, error)
NewConfig create a new Popeye configuration.
func (*Config) AllowedRegistries ¶ added in v0.10.0
func (c *Config) AllowedRegistries() []string
AllowedRegistries tracks allowed docker registries.
func (*Config) CPUResourceLimits ¶ added in v0.3.0
func (c *Config) CPUResourceLimits() Allocations
CPUResourceLimits returns memory over/under allocation thresholds.
func (*Config) ExcludeContainer ¶ added in v0.20.0
func (c *Config) ExcludeContainer(gvr types.GVR, fqn, co string) bool
func (*Config) ExcludeFQN ¶ added in v0.20.0
func (c *Config) ExcludeFQN(gvr types.GVR, fqn string, cos []string) bool
func (*Config) MEMResourceLimits ¶ added in v0.3.0
func (c *Config) MEMResourceLimits() Allocations
MEMResourceLimits returns memory over/under allocation thresholds.
func (*Config) NodeCPULimit ¶
func (c *Config) NodeCPULimit() float64
NodeCPULimit returns the node cpu threshold if set otherwise the default.
func (*Config) NodeMEMLimit ¶
func (c *Config) NodeMEMLimit() float64
NodeMEMLimit returns the pod mem threshold if set otherwise the default.
func (*Config) PodCPULimit ¶
func (c *Config) PodCPULimit() float64
PodCPULimit returns the pod cpu threshold if set otherwise the default.
func (*Config) PodMEMLimit ¶
func (c *Config) PodMEMLimit() float64
PodMEMLimit returns the pod mem threshold if set otherwise the default.
func (*Config) RestartsLimit ¶
func (c *Config) RestartsLimit() int
RestartsLimit returns pod restarts limit.
type Flags ¶ added in v0.3.4
type Flags struct {
*genericclioptions.ConfigFlags
PushGateway *PushGateway
S3 *S3Info
LintLevel *string
Output *string
ClearScreen *bool
Save *bool
OutputFile *string
CheckOverAllocs *bool
AllNamespaces *bool
Spinach *string
Sections *[]string
InClusterName *string
StandAlone bool
ActiveNamespace *string
ForceExitZero *bool
MinScore *int
LogLevel *int
LogFile *string
}
Flags represents Popeye CLI flags.
func (*Flags) IsPersistent ¶ added in v0.20.0
func (f *Flags) IsPersistent() bool
func (*Flags) OutputFormat ¶ added in v0.3.4
func (f *Flags) OutputFormat() string
OutputFormat returns the report output format.
type Limits ¶
type Limits struct {
CPU float64 `yaml:"cpu"`
Memory float64 `yam:"memory"`
}
Limits tracks cpu and mem limits.
type Pod ¶
type Pod struct {
Restarts int `yaml:"restarts"`
Limits Limits `yaml:"limits"`
}
Pod tracks pod configurations.
type Popeye ¶
type Popeye struct {
// AllocationLimits tracks global resource allocations.
AllocationLimits `yaml:"allocations"`
// Excludes tracks linter exclusions.
Exclusions rules.Exclusions `yaml:"excludes"`
// Resources tracks cpu/mem limits.
Resources Resources `yaml:"resources"`
// Codes provides to override codes severity.
Overrides rules.Overrides `yaml:"overrides"`
// Registries tracks allowed docker registries.
Registries []string `yaml:"registries"`
}
Popeye tracks Popeye configuration options.
type PushGateway ¶ added in v0.9.1
type PushGateway struct {
URL *string
BasicAuth BasicAuth
}
PushGateway tracks prometheus gateway representations.