recommendation

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResourceEventsForConfig

func ResourceEventsForConfig(recCfg *config.Recommendations) map[string]config.EventType

ResourceEventsForConfig returns the resource event map for a given source recommendations config.

func ShouldIgnoreEvent

func ShouldIgnoreEvent(recCfg *config.Recommendations, event event.Event) bool

ShouldIgnoreEvent returns true if user doesn't listen to events for a given resource, apart from enabled recommendations.

Types

type AggregatedRunner

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

AggregatedRunner contains multiple recommendations to run.

func (AggregatedRunner) Do

func (s AggregatedRunner) Do(ctx context.Context, event *event.Event) error

Do runs all recommendations within the set.

type Factory

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

Factory is a factory for creating recommendation sets.

func NewFactory

func NewFactory(logger logrus.FieldLogger, dynamicCli dynamic.Interface) *Factory

NewFactory creates a new Factory instance.

func (*Factory) New

New creates a new AggregatedRunner.

type IngressBackendServiceValid

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

IngressBackendServiceValid checks if service and tls secret used in ingress specs is already present and adds recommendations to event struct accordingly

func NewIngressBackendServiceValid

func NewIngressBackendServiceValid(dynamicCli dynamic.Interface) *IngressBackendServiceValid

NewIngressBackendServiceValid creates a new IngressBackendServiceValid instance.

func (*IngressBackendServiceValid) Do

Do executes the recommendation checks.

func (*IngressBackendServiceValid) Name

Name returns the recommendation name

type IngressTLSSecretValid

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

IngressTLSSecretValid adds recommendations if TLS secrets used in Ingress specs don't exist.

func NewIngressTLSSecretValid

func NewIngressTLSSecretValid(dynamicCli dynamic.Interface) *IngressTLSSecretValid

NewIngressTLSSecretValid creates a new IngressTLSSecretValid instance.

func (*IngressTLSSecretValid) Do

Do executes the recommendation checks.

func (*IngressTLSSecretValid) Name

func (f *IngressTLSSecretValid) Name() string

Name returns the recommendation name

type PodLabelsSet

type PodLabelsSet struct{}

PodLabelsSet adds recommendation when newly created Pods have no labels.

func NewPodLabelsSet

func NewPodLabelsSet() *PodLabelsSet

NewPodLabelsSet creates a new PodLabelsSet instance.

func (PodLabelsSet) Do

func (f PodLabelsSet) Do(_ context.Context, event event.Event) (Result, error)

Do executes the recommendation checks.

func (*PodLabelsSet) Name

func (f *PodLabelsSet) Name() string

Name returns the recommendation name.

type PodNoLatestImageTag

type PodNoLatestImageTag struct{}

PodNoLatestImageTag add recommendations if latest image tag is used in Pod containers.

func NewPodNoLatestImageTag

func NewPodNoLatestImageTag() *PodNoLatestImageTag

NewPodNoLatestImageTag creates a new PodNoLatestImageTag instance.

func (*PodNoLatestImageTag) Do

Do executes the recommendation checks.

func (*PodNoLatestImageTag) Name

func (f *PodNoLatestImageTag) Name() string

Name returns the recommendation name.

type Recommendation

type Recommendation interface {
	Do(ctx context.Context, event event.Event) (Result, error)
	Name() string
}

Recommendation performs checks for a given event.

type Result

type Result struct {
	Info     []string
	Warnings []string
}

Result is the result of a recommendation check.

Jump to

Keyboard shortcuts

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