operatingsystemconfig

package
v1.147.2 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2026 License: Apache-2.0 Imports: 30 Imported by: 11

Documentation

Index

Constants

View Source
const (
	// FinalizerName is the name of the finalizer written by this controller.
	FinalizerName = "extensions.gardener.cloud/operatingsystemconfigs"

	// ControllerName is the name of the operating system configuration controller.
	ControllerName = "operatingsystemconfig"
)

Variables

This section is empty.

Functions

func Add

func Add(mgr manager.Manager, args AddArgs) error

Add adds an operatingsystemconfig controller to the given manager using the given AddArgs.

func DefaultPredicates

func DefaultPredicates(ctx context.Context, mgr manager.Manager, ignoreOperationAnnotation bool) []predicate.Predicate

DefaultPredicates returns the default predicates for an operatingsystemconfig reconciler.

func FilesToDiskScript added in v1.82.0

func FilesToDiskScript(ctx context.Context, reader client.Reader, namespace string, files []extensionsv1alpha1.File) (string, error)

FilesToDiskScript is a utility function which generates a bash script for writing the provided files to the disk.

func NewReconciler

func NewReconciler(mgr manager.Manager, actuator Actuator) reconcile.Reconciler

NewReconciler creates a new reconcile.Reconciler that reconciles OperatingSystemConfig resources of Gardener's `extensions.gardener.cloud` API group.

func SecretObjectMetaForConfig

func SecretObjectMetaForConfig(config *extensionsv1alpha1.OperatingSystemConfig) metav1.ObjectMeta

SecretObjectMetaForConfig returns the object meta structure that can be used inside the secret that shall contain the generated OSC output.

func UnitsToDiskScript added in v1.82.0

func UnitsToDiskScript(units []extensionsv1alpha1.Unit) string

UnitsToDiskScript is a utility function which generates a bash script for writing the provided units and their drop-ins to the disk.

func WrapProvisionOSCIntoOneshotScript added in v1.110.5

func WrapProvisionOSCIntoOneshotScript(script string) string

WrapProvisionOSCIntoOneshotScript wraps the given script into an oneshot script which exits early when it is called again after finishing successfully.

Types

type Actuator

type Actuator interface {
	// Reconcile reconciles the [extensionsv1alpha1.OperatingSystemConfig]
	// resource.
	//
	// Implementations should ensure that any resources (e.g. systemd units,
	// files, etc.) are created or updated in order to reach their desired
	// state.
	Reconcile(context.Context, logr.Logger, *extensionsv1alpha1.OperatingSystemConfig) ([]byte, []extensionsv1alpha1.Unit, []extensionsv1alpha1.File, *extensionsv1alpha1.InPlaceUpdatesStatus, error)

	// Delete is invoked when the [extensionsv1alpha1.OperatingSystemConfig]
	// resource is deleted.
	//
	// Implementations should take care of cleaning up any resources
	// (e.g. systemd units, files, etc.), which were created by the
	// Extension.
	//
	// Implementations must wait until all resources managed by the
	// extension have been gracefully cleaned up.
	Delete(context.Context, logr.Logger, *extensionsv1alpha1.OperatingSystemConfig) error

	// ForceDelete is invoked when the shoot cluster associated with the
	// [extensionsv1alpha1.OperatingSystemConfig] is deleted in a forceful
	// manner.
	//
	// Implementations should take care of unblocking the deletion flow by
	// attempting to cleanup any related resources, and skip waiting for
	// external resources, if they cannot be deleted gracefully.
	//
	// If some resources managed by the extension implementation cannot be
	// deleted gracefully, this method should still succeed, even if some
	// resources are orphaned.
	ForceDelete(context.Context, logr.Logger, *extensionsv1alpha1.OperatingSystemConfig) error

	// Restore restores the operating system config from a previously saved
	// state.
	//
	// This method is invoked when the shoot cluster associated with the
	// [extensionsv1alpha1.OperatingSystemConfig] resource is being restored
	// on the target seed cluster.
	//
	// Implementations may use the persisted data in the .status.state field
	// for restoring the state, when the shoot is being migrated to a
	// different seed cluster.
	Restore(context.Context, logr.Logger, *extensionsv1alpha1.OperatingSystemConfig) ([]byte, []extensionsv1alpha1.Unit, []extensionsv1alpha1.File, *extensionsv1alpha1.InPlaceUpdatesStatus, error)

	// Migrate prepares the extension for migration.
	//
	// This method is invoked when the shoot cluster associated with the
	// [extensionsv1alpha1.OperatingSystemResource] resource is being
	// migrated to another seed cluster.
	//
	// Implementations should take care of storing any required state in the
	// .status.state field, so that it can later be restored from this
	// state.
	Migrate(context.Context, logr.Logger, *extensionsv1alpha1.OperatingSystemConfig) error
}

Actuator acts upon extensionsv1alpha1.OperatingSystemConfig resources.

type AddArgs

type AddArgs struct {
	// Actuator is an OperatingSystemConfig actuator.
	Actuator Actuator
	// ControllerOptions are the controller options used for creating a controller.
	// The options.Reconciler is always overridden with a reconciler created from the
	// given actuator.
	ControllerOptions controller.Options
	// Predicates are the predicates to use.
	// If unset, GenerationChangedPredicate will be used.
	Predicates []predicate.Predicate
	// Types are the similar types which can be combined with a logic or,
	// of the resource considered for reconciliation.
	Types []string
	// ExtensionClasses defines the extension classes this controller is responsible for.
	ExtensionClasses []extensionsv1alpha1.ExtensionClass
}

AddArgs are arguments for adding an OperatingSystemConfig controller to a manager.

Jump to

Keyboard shortcuts

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