Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ControlScoreWeights ¶
type ScoreUtil ¶
type ScoreUtil struct { ResourceTypeScores map[string]float32 FrameworksScore map[string]map[string]ControlScoreWeights K8SApoObj *k8sinterface.KubernetesApi // contains filtered or unexported fields }
func NewScore ¶
func NewScore(k8sapiobj *k8sinterface.KubernetesApi, configPath string) *ScoreUtil
func (*ScoreUtil) Calculate ¶
func (su *ScoreUtil) Calculate(frameworksReports []opapolicy.FrameworkReport) error
func (*ScoreUtil) CalculateFrameworkScore ¶
func (su *ScoreUtil) CalculateFrameworkScore(framework *opapolicy.FrameworkReport) error
func (*ScoreUtil) ControlScore ¶
func (su *ScoreUtil) ControlScore(ctrlReport *opapolicy.ControlReport, frameworkName string) float32
ControlScore: @input: ctrlReport - opapolicy.ControlReport object, must contain down the line the Input resources and the output resources frameworkName - calculate this control according to a given framework weights
ctrl.score = baseScore * SUM_resource (resourceWeight*min(#replicas*replicaweight,1)(nodes if daemonset)
returns control score ***for the input resources***
Click to show internal directories.
Click to hide internal directories.