Documentation ¶
Index ¶
- Constants
- type ClusterGroupUpgradeReconciler
- type ConfigurationObject
- type IBGUReconciler
- type ManagedClusterForCguReconciler
- func (r *ManagedClusterForCguReconciler) GetConfigurationObjects(policies []policiesv1.Policy) ([]unstructured.Unstructured, error)
- func (r *ManagedClusterForCguReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (r *ManagedClusterForCguReconciler) SetupWithManager(mgr ctrl.Manager) error
Constants ¶
const ( BackupStatePreparingToStart = "PreparingToStart" BackupStateStarting = "Starting" BackupStateActive = "Active" BackupStateSucceeded = "Succeeded" BackupStateTimeout = "BackupTimeout" BackupStateError = "UnrecoverableError" )
Backup states
const ( PrecacheStateNotStarted = "NotStarted" PrecacheStatePreparingToStart = "PreparingToStart" PrecacheStateStarting = "Starting" PrecacheStateActive = "Active" PrecacheStateSucceeded = "Succeeded" PrecacheStateTimeout = "PrecacheTimeout" PrecacheStateError = "UnrecoverableError" )
Pre-cache states
const ( NoNsView = "NoNsView" NoNsFoundOnSpoke = "NoNsFoundOnSpoke" NsFoundOnSpoke = "NsFoundOnSpoke" NoJobView = "NoJobView" NoJobFoundOnSpoke = "NoJobFoundOnSpoke" JobViewExists = "JobViewExists" DependenciesViewNotPresent = "DependenciesViewNotPresent" DependenciesNotPresent = "DependenciesNotPresent" JobDeadline = "JobDeadline" JobSucceeded = "JobSucceeded" JobActive = "JobActive" JobBackoffLimitExceeded = "JobBackoffLimitExceeded" UnforeseenCondition = "UnforeseenCondition" )
Jobresources conditions
const LcaAnnotationSuffix = "lca.openshift.io"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClusterGroupUpgradeReconciler ¶
type ClusterGroupUpgradeReconciler struct { client.Client Log logr.Logger Scheme *runtime.Scheme Recorder record.EventRecorder }
ClusterGroupUpgradeReconciler reconciles a ClusterGroupUpgrade object
func (*ClusterGroupUpgradeReconciler) Reconcile ¶
func (r *ClusterGroupUpgradeReconciler) Reconcile(ctx context.Context, req ctrl.Request) (nextReconcile ctrl.Result, err error)
Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state. TODO(user): Modify the Reconcile function to compare the state specified by the ClusterGroupUpgrade object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.
For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.8.3/pkg/reconcile
func (*ClusterGroupUpgradeReconciler) SetupWithManager ¶
func (r *ClusterGroupUpgradeReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type ConfigurationObject ¶
type ConfigurationObject struct { Kind string `json:"kind,omitempty"` Name string `json:"name,omitempty"` APIVersion string `json:"apiVersion,omitempty"` Namespace *string `json:"namespace,omitempty"` }
ConfigurationObject defines the details of an object configured through a Policy
type IBGUReconciler ¶
type IBGUReconciler struct { client.Client Log logr.Logger Scheme *runtime.Scheme Recorder record.EventRecorder }
IBGUReconciler reconciles a ImageBasedGroupUpgrade object
func (*IBGUReconciler) Reconcile ¶
func (r *IBGUReconciler) Reconcile(ctx context.Context, req ctrl.Request) (nextReconcile ctrl.Result, err error)
Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.
For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.8.3/pkg/reconcile
func (*IBGUReconciler) SetupWithManager ¶
func (r *IBGUReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type ManagedClusterForCguReconciler ¶
ManagedClusterForCguReconciler reconciles a ManagedCluster object to auto create the ClusterGroupUpgrade
func (*ManagedClusterForCguReconciler) GetConfigurationObjects ¶
func (r *ManagedClusterForCguReconciler) GetConfigurationObjects(policies []policiesv1.Policy) ([]unstructured.Unstructured, error)
GetConfigurationObjects gets encapsulated objects from configuration policies
func (*ManagedClusterForCguReconciler) Reconcile ¶
func (r *ManagedClusterForCguReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
Reconcile the managed cluster auto create ClusterGroupUpgrade
- Controller watches for create event of managed cluster object. Reconciliation is triggered when a new managed cluster is created
- When a new managed cluster is created, create ClusterGroupUpgrade CR for the cluster only when it's ready and its child policies are available
- As created ClusterGroupUpgrade has ownReference set to its managed cluster, when the managed cluster is deleted, the ClusterGroupUpgrade will be auto-deleted
Note: The Controller will requeue the Request to be processed again if the returned error is non-nil or Result.Requeue is true, otherwise upon completion it will remove the work from the queue.
func (*ManagedClusterForCguReconciler) SetupWithManager ¶
func (r *ManagedClusterForCguReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.