controller

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2025 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ExceptionRecommenderFinalizer = "policy.giantswarm.io/exception-recommender"
	ManifestExpectedMode          = "warming"
)
View Source
const (
	ErrorOp  = "error"
	UpdateOp = "updated"
	NoOp     = "unchanged"
	CreateOp = "created"
)

Variables

View Source
var DefaultRequeueDuration = (time.Minute * 5)

Used for Jitter in requeueing

View Source
var (
	ReconciliationFailuresMetric = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Name: "exception_recommender_reconciliation_failures_total",
			Help: "Number of failed reconciliations",
		}, []string{"resource_type"},
	)
)

Functions

func GetPolicyManifestMode added in v0.2.0

func GetPolicyManifestMode(policyName string, cache map[string]policyAPI.PolicyManifest) string

Types

type Controller added in v0.2.0

type Controller struct {
	client.Client
}

func (*Controller) CreateOrUpdate added in v0.2.0

func (r *Controller) CreateOrUpdate(ctx context.Context, obj client.Object) (string, error)

CreateOrUpdate attempts first to patch the object given but if an IsNotFound error is returned it instead creates the resource.

type PolicyManifestReconciler added in v0.2.0

type PolicyManifestReconciler struct {
	client.Client
	Scheme              *runtime.Scheme
	Log                 logr.Logger
	PolicyManifestCache map[string]policyAPI.PolicyManifest
	MaxJitterPercent    int
}

PolicyManifestReconciler reconciles a PolicyManifest object

func (*PolicyManifestReconciler) Reconcile added in v0.2.0

func (*PolicyManifestReconciler) SetupWithManager added in v0.2.0

func (r *PolicyManifestReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type PolicyReportReconciler

type PolicyReportReconciler struct {
	client.Client
	Scheme               *runtime.Scheme
	Log                  logr.Logger
	ExcludeNamespaces    []string
	DestinationNamespace string
	PolicyManifestCache  map[string]policyAPI.PolicyManifest
	TargetWorkloads      []string
	TargetCategories     []string
	MaxJitterPercent     int
}

PolicyReportReconciler reconciles a PolicyReport object

func (*PolicyReportReconciler) Reconcile

func (r *PolicyReportReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

func (*PolicyReportReconciler) SetupWithManager

func (r *PolicyReportReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

Jump to

Keyboard shortcuts

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