OptimizationRule

Trait OptimizationRule 

Source
pub trait OptimizationRule: Send + Sync {
    // Required methods
    fn code(&self) -> &'static str;
    fn description(&self) -> &'static str;
    fn default_severity(&self) -> Severity;
    fn check(
        &self,
        ctx: &RuleContext,
        config: &K8sOptimizeConfig,
    ) -> Option<ResourceRecommendation>;
}
Expand description

Trait for optimization rules.

Required Methods§

Source

fn code(&self) -> &'static str

Get the rule code (e.g., “K8S-OPT-001”).

Source

fn description(&self) -> &'static str

Get the rule description.

Source

fn default_severity(&self) -> Severity

Get the default severity for this rule.

Source

fn check( &self, ctx: &RuleContext, config: &K8sOptimizeConfig, ) -> Option<ResourceRecommendation>

Check if this rule applies and generate a recommendation if so.

Implementors§