controllers

package
v0.0.0-...-cf5b4af Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 49 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BackupStatePreparingToStart = "PreparingToStart"
	BackupStateStarting         = "Starting"
	BackupStateActive           = "Active"
	BackupStateSucceeded        = "Succeeded"
	BackupStateTimeout          = "BackupTimeout"
	BackupStateError            = "UnrecoverableError"
)

Backup states

View Source
const (
	PrecacheStateNotStarted       = "NotStarted"
	PrecacheStatePreparingToStart = "PreparingToStart"
	PrecacheStateStarting         = "Starting"
	PrecacheStateActive           = "Active"
	PrecacheStateSucceeded        = "Succeeded"
	PrecacheStateTimeout          = "PrecacheTimeout"
	PrecacheStateError            = "UnrecoverableError"
)

Pre-cache states

View Source
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

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 ManagedClusterForCguReconciler

type ManagedClusterForCguReconciler struct {
	client.Client
	Log    logr.Logger
	Scheme *runtime.Scheme
}

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

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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