controllers

package
v0.0.0-...-9ca1187 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2026 License: Apache-2.0 Imports: 47 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultManagedNamespace = "openshift-cloud-controller-manager"

	// OperatorNamespace is the namespace the operator's own Deployment (and the
	// resources it creates directly, e.g. the node-label-sync Job) run in.
	OperatorNamespace = "openshift-cloud-controller-manager-operator"

	OpenshiftConfigNamespace        = "openshift-config"
	OpenshiftManagedConfigNamespace = "openshift-config-managed"
)
View Source
const (
	ReasonAsExpected          = "AsExpected"
	ReasonInitializing        = "Initializing"
	ReasonSyncing             = "SyncingResources"
	ReasonSyncFailed          = "SyncingFailed"
	ReasonPlatformTechPreview = "PlatformTechPreview"
)

The default set of status change reasons.

Variables

This section is empty.

Functions

func GetReleaseVersion

func GetReleaseVersion() string

GetReleaseVersion gets the release version string from the env

func SyncVSphereNodeLabels

func SyncVSphereNodeLabels(ctx context.Context, c client.Client) error

SyncVSphereNodeLabels performs a single pass over all nodes and retroactively applies the node.openshift.io/platform-type=vsphere label to vSphere nodes that are missing it. The vSphere CCM only ever applies this label (via its --node-labels flag, see pkg/cloud/vsphere) when it initializes a node for the first time, so nodes that joined the cluster before the VSphereMixedNodeEnv feature gate was enabled never get labeled without this repair pass. Hybrid clusters can mix vSphere and bare-metal nodes, so each node's spec.providerID is checked to confirm it is actually a vSphere node before labeling it.

This is run to completion once by the node-label-sync-job Job, which the operator's own NodeLabelSyncJobReconciler creates on demand (see node_label_sync_job_controller.go) rather than as an ongoing in-process controller.

Types

type CloudConfigReconciler

type CloudConfigReconciler struct {
	ClusterOperatorStatusClient
	Scheme            *runtime.Scheme
	FeatureGateAccess featuregates.FeatureGateAccess
	// contains filtered or unexported fields
}

func (*CloudConfigReconciler) Reconcile

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

func (*CloudConfigReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type CloudOperatorReconciler

type CloudOperatorReconciler struct {
	ClusterOperatorStatusClient
	Scheme *runtime.Scheme

	ImagesFile        string
	FeatureGateAccess featuregates.FeatureGateAccess
	TLSConfig         func(*tls.Config)
	// contains filtered or unexported fields
}

CloudOperatorReconciler reconciles a ClusterOperator object

func (*CloudOperatorReconciler) Reconcile

func (r *CloudOperatorReconciler) Reconcile(ctx context.Context, _ ctrl.Request) (result ctrl.Result, retErr error)

Reconcile will process the cloud-controller-manager clusterOperator

func (*CloudOperatorReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type ClusterOperatorStatusClient

type ClusterOperatorStatusClient struct {
	client.Client
	Recorder         record.EventRecorder
	Clock            clock.PassiveClock
	ManagedNamespace string
	ReleaseVersion   string
}

type NodeLabelSyncJobReconciler

type NodeLabelSyncJobReconciler struct {
	client.Client
	// Namespace is where the node-label-sync Job is created. Set to controllers.OperatorNamespace
	// in production; tests may point it at a dedicated test namespace.
	Namespace string
	// Image is the container image stamped onto the Job, read from the OPERATOR_IMAGE env
	// variable, which carries the same resolved pullspec as the running operator image.
	Image string
	// ReleaseVersion is stamped onto the Job's RELEASE_VERSION env variable.
	ReleaseVersion    string
	FeatureGateAccess featuregates.FeatureGateAccess
}

NodeLabelSyncJobReconciler ensures the node-label-sync Job exists on vSphere clusters with the VSphereMixedNodeEnv feature gate enabled, creating it if it's missing. It never updates or deletes the Job once created: the Job's pod template is immutable, so this mirrors the "backfill once" semantics that a CVO-installed manifest would get from the release.openshift.io/create-only annotation, without going through CVO's manifest-apply path.

func (*NodeLabelSyncJobReconciler) Reconcile

func (*NodeLabelSyncJobReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type ObjectWatcher

type ObjectWatcher interface {
	Watch(ctx context.Context, obj client.Object) error
	EventStream() <-chan event.GenericEvent
}

func NewObjectWatcher

func NewObjectWatcher(opts WatcherOptions) (ObjectWatcher, error)

type TrustedCABundleReconciler

type TrustedCABundleReconciler struct {
	ClusterOperatorStatusClient
	Scheme *runtime.Scheme
	// contains filtered or unexported fields
}

func (*TrustedCABundleReconciler) Reconcile

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

func (*TrustedCABundleReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type WatcherOptions

type WatcherOptions struct {
	Cache  cache.Cache
	Scheme *runtime.Scheme
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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