controllers

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: BSD-3-Clause Imports: 36 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// https://github.com/openshift/machine-config-operator/blob/b36482885ba1304e122e7c01c26cd671dfdd0418/pkg/daemon/constants/constants.go#L17
	// https://github.com/openshift/machine-config-operator/blob/b36482885ba1304e122e7c01c26cd671dfdd0418/pkg/daemon/drain.go#L79
	// DesiredDrainerAnnotationKey is set by OCP to indicate drain/uncordon requests
	DesiredDrainerAnnotationKey = "machineconfiguration.openshift.io/desiredDrain"
	// LastAppliedDrainerAnnotationKey is by OCP to indicate the last request applied
	LastAppliedDrainerAnnotationKey = "machineconfiguration.openshift.io/lastAppliedDrain"
)
View Source
const MetricsNamespace = "openshift_upgrade_controller"
View Source
const (
	UpgradeJobHookJobTrackerFinalizer = "upgradejobs.managedupgrade.appuio.io/hook-job-tracker"
)

Variables

View Source
var ClusterVersionLockAnnotation = managedupgradev1beta1.GroupVersion.Group + "/upgrade-job"

Functions

func JobFromClusterVersionMapper

func JobFromClusterVersionMapper(c client.Reader, cvName string) handler.MapFunc

JobFromClusterVersionMapper returns the job locking the cluster version or nothing. The given object is ignored.

Types

type Clock

type Clock interface {
	Now() time.Time
}

type ClusterUpgradingMetric

type ClusterUpgradingMetric struct {
	client.Client

	ManagedUpstreamClusterVersionName string
}

ClusterUpgradingMetric is a Prometheus collector that exposes the link between an organization and a billing entity.

func (*ClusterUpgradingMetric) Collect

func (m *ClusterUpgradingMetric) Collect(ch chan<- prometheus.Metric)

Collect implements prometheus.Collector. Sends a metric if the cluster is currently upgrading and a upgrading metric for each machine config pool.

func (*ClusterUpgradingMetric) Describe

func (*ClusterUpgradingMetric) Describe(ch chan<- *prometheus.Desc)

Describe implements prometheus.Collector. Sends the static description of the metrics to the provided channel.

type ClusterVersionReconciler

type ClusterVersionReconciler struct {
	client.Client
	Scheme *runtime.Scheme

	ManagedUpstreamClusterVersionName string
	ManagedClusterVersionName         string
	ManagedClusterVersionNamespace    string
}

ClusterVersionReconciler reconciles a ClusterVersion object

func (*ClusterVersionReconciler) Filter

func (r *ClusterVersionReconciler) Filter(obj client.Object) bool

Filter filters the ClusterVersion objects to only reconcile the managed ClusterVersion object. Returns true if the object is managed by this controller.

func (*ClusterVersionReconciler) Reconcile

Reconcile compares the ClusterVersion object with the upstream ClusterVersion object and updates the upstream ClusterVersion object if necessary.

func (*ClusterVersionReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager. The controller is setup to watch the managed ClusterVersion object and the upstream ClusterVersion object.

type NodeReconciler

type NodeReconciler struct {
	client.Client
	Scheme *runtime.Scheme
}

NodeReconciler reconciles a Node object

func (*NodeReconciler) Reconcile

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

Reconcile reacts to Node changes and updates the node draining metric.

func (*NodeReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type UpgradeConfigReconciler

type UpgradeConfigReconciler struct {
	client.Client
	Scheme *runtime.Scheme

	Clock Clock

	ManagedUpstreamClusterVersionName string
}

UpgradeConfigReconciler reconciles a UpgradeConfig object

func (*UpgradeConfigReconciler) Reconcile

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

Reconcile implements the reconcile loop for UpgradeConfig. It schedules UpgradeJobs based on the UpgradeConfig's schedule - if an update is available.

func (*UpgradeConfigReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type UpgradeJobReconciler

type UpgradeJobReconciler struct {
	client.Client
	Scheme *runtime.Scheme

	Clock Clock

	ManagedUpstreamClusterVersionName string
}

UpgradeJobReconciler reconciles a UpgradeJob object

func (*UpgradeJobReconciler) Reconcile

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

Reconcile reconciles a UpgradeJob object and starts the upgrade if necessary.

func (*UpgradeJobReconciler) SetupWithManager

func (r *UpgradeJobReconciler) 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