controllers

package
v0.0.0-...-ef30b53 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: Apache-2.0 Imports: 51 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvSkipRecert = "SEEDGEN_SKIP_RECERT"
)

Variables

CheckHealth helper func to call HealthChecks

Functions

func CleanupUnbootedStateroots

func CleanupUnbootedStateroots(log logr.Logger, ops ops.Ops, ostreeClient ostreeclient.IClient, rpmOstreeClient rpmostreeclient.IClient) error

Types

type ImageBasedUpgradeReconciler

type ImageBasedUpgradeReconciler struct {
	client.Client
	NoncachedClient client.Reader
	UpgradeHandler  UpgradeHandler
	Log             logr.Logger
	Scheme          *runtime.Scheme
	Recorder        record.EventRecorder
	Precache        *precache.PHandler
	BackupRestore   backuprestore.BackuperRestorer
	ExtraManifest   extramanifest.EManifestHandler
	RPMOstreeClient rpmostreeclient.IClient
	Executor        ops.Execute
	OstreeClient    ostreeclient.IClient
	Ops             ops.Ops
	RebootClient    reboot.RebootIntf
	Mux             *sync.Mutex
	Clientset       *kubernetes.Clientset
}

ImageBasedUpgradeReconciler reconciles a ImageBasedUpgrade object

func (*ImageBasedUpgradeReconciler) Reconcile

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

func (*ImageBasedUpgradeReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type SeedGeneratorReconciler

type SeedGeneratorReconciler struct {
	client.Client
	NoncachedClient client.Reader
	Log             logr.Logger
	Scheme          *runtime.Scheme
	Recorder        record.EventRecorder
	Executor        ops.Execute
	Mux             *sync.Mutex
}

SeedGeneratorReconciler reconciles a SeedGenerator object

func (*SeedGeneratorReconciler) Reconcile

func (r *SeedGeneratorReconciler) Reconcile(ctx context.Context, req ctrl.Request) (nextReconcile ctrl.Result, rc 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 (*SeedGeneratorReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type UpgHandler

type UpgHandler struct {
	client.Client
	NoncachedClient client.Reader
	Log             logr.Logger
	BackupRestore   backuprestore.BackuperRestorer
	ExtraManifest   extramanifest.EManifestHandler
	ClusterConfig   clusterconfig.UpgradeClusterConfigGatherer
	Executor        ops.Execute
	Ops             ops.Ops
	Recorder        record.EventRecorder
	RPMOstreeClient rpmostreeclient.IClient
	OstreeClient    ostreeclient.IClient
	RebootClient    reboot.RebootIntf
}

func (*UpgHandler) HandleBackup

func (u *UpgHandler) HandleBackup(ctx context.Context, ibu *lcav1alpha1.ImageBasedUpgrade) (ctrl.Result, error)

HandleBackup manages backup flow and returns with possible requeue

func (*UpgHandler) HandleRestore

func (u *UpgHandler) HandleRestore(ctx context.Context) (ctrl.Result, error)

func (*UpgHandler) PostPivot

PostPivot executes all the post-upgrade steps after the cluster is rebooted to the new stateroot.

Note: All decisions, including reconciles and failures, should be made within this function. The caller will simply return what this function returns.

func (*UpgHandler) PrePivot

prePivot executes all the pre-upgrade steps and initiates a cluster reboot.

Note: All decisions, including reconciles and failures, should be made within this function. The caller will simply return what this function returns.

type UpgradeHandler

type UpgradeHandler interface {
	HandleBackup(ctx context.Context, ibu *lcav1alpha1.ImageBasedUpgrade) (ctrl.Result, error)
	HandleRestore(ctx context.Context) (ctrl.Result, error)
	PostPivot(ctx context.Context, ibu *lcav1alpha1.ImageBasedUpgrade) (ctrl.Result, error)
	PrePivot(ctx context.Context, ibu *lcav1alpha1.ImageBasedUpgrade) (ctrl.Result, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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