controllers

package
v0.0.0-...-3340f48 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const DeploymentWaitTimeout = 60
View Source
const TemplateDir = "/etc/plugin_templates/"

TODO: yes, hardcoded for now. Move to luigi and addon-operator once release is stable

Variables

This section is empty.

Functions

func ApplyObject

func ApplyObject(ctx context.Context, client client.Client, obj *uns.Unstructured) error

ApplyObject applies the desired object against the apiserver, merging it with any existing objects if already present.

func DeleteObject

func DeleteObject(ctx context.Context, client client.Client, obj *uns.Unstructured) error

DeleteObject deletes the desired object against the apiserver,

func IsObjectSupported

func IsObjectSupported(obj *uns.Unstructured) error

IsObjectSupported rejects objects with configurations we don't support. This catches ServiceAccounts with secrets, which is valid but we don't support reconciling them.

func MergeDeploymentForUpdate

func MergeDeploymentForUpdate(current, updated *uns.Unstructured) error

MergeDeploymentForUpdate updates Deployment objects. We merge annotations, keeping ours except the Deployment Revision annotation.

func MergeMetadataForUpdate

func MergeMetadataForUpdate(current, updated *uns.Unstructured) error

MergeMetadataForUpdate merges the read-only fields of metadata. This is to be able to do a a meaningful comparison in apply, since objects created on runtime do not have these fields populated.

func MergeObjectForUpdate

func MergeObjectForUpdate(current, updated *uns.Unstructured) error

MergeObjectForUpdate prepares a "desired" object to be updated. Some objects, such as Deployments and Services require some semantic-aware updates

func MergeServiceAccountForUpdate

func MergeServiceAccountForUpdate(current, updated *uns.Unstructured) error

MergeServiceAccountForUpdate copies secrets from current to updated. This is intended to preserve the auto-generated token. Right now, we just copy current to updated and don't support supplying any secrets ourselves.

func MergeServiceForUpdate

func MergeServiceForUpdate(current, updated *uns.Unstructured) error

MergeServiceForUpdate ensures the clusterip is never written to

Types

type DeployCtx

type DeployCtx struct {
	Client client.Client
	Log    logr.Logger
	// contains filtered or unexported fields
}

func NewDeployCtx

func NewDeployCtx(log logr.Logger, client client.Client) *DeployCtx

func (*DeployCtx) DeployDependencies

func (ctx *DeployCtx) DeployDependencies() error

func (*DeployCtx) GetDeployment

func (ctx *DeployCtx) GetDeployment(name, namespace string) (*appsv1.Deployment, error)

func (*DeployCtx) WaitForDeployment

func (ctx *DeployCtx) WaitForDeployment(name, namespace string, timeoutSeconds int) error

type NetReqWrapper

type NetReqWrapper struct {
	Log    logr.Logger
	Client client.Client
	// contains filtered or unexported fields
}

func NewNetReqWrapper

func NewNetReqWrapper(log logr.Logger, client client.Client) *NetReqWrapper

func (*NetReqWrapper) WithCNIProvider

func (req *NetReqWrapper) WithCNIProvider(provider cni.CNIProvider) *NetReqWrapper

func (*NetReqWrapper) WithNetwork

func (req *NetReqWrapper) WithNetwork(network *plumberv1.NetworkWizard) *NetReqWrapper

type NetworkWizardReconciler

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

NetworkWizardReconciler reconciles a NetworkWizard object

func (*NetworkWizardReconciler) GetVMsForNetwork

func (r *NetworkWizardReconciler) GetVMsForNetwork(network *plumberv1.NetworkWizard) ([]*kubevirtv1.VirtualMachine, error)

func (*NetworkWizardReconciler) Reconcile

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

func (*NetworkWizardReconciler) ReconcileDelete

func (r *NetworkWizardReconciler) ReconcileDelete(ctx context.Context, req *NetReqWrapper) error

func (*NetworkWizardReconciler) ReconcileNetwork

func (r *NetworkWizardReconciler) ReconcileNetwork(ctx context.Context, req *NetReqWrapper) (ctrl.Result, error)

func (*NetworkWizardReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type VMAnnotator

type VMAnnotator struct {
	Client client.Client
	// contains filtered or unexported fields
}

func (*VMAnnotator) Handle

func (*VMAnnotator) InjectDecoder

func (a *VMAnnotator) InjectDecoder(d *admission.Decoder) error

type VMReconciler

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

NetworkWizardReconciler reconciles a NetworkWizard object

func (*VMReconciler) DeleteIPAllocationsForVM

func (r *VMReconciler) DeleteIPAllocationsForVM(ctx context.Context, req *VMReqWrapper) error

func (*VMReconciler) GetNetworksForVM

func (r *VMReconciler) GetNetworksForVM(ctx context.Context, req *VMReqWrapper) ([]*plumberv1.NetworkWizard, error)

func (*VMReconciler) Reconcile

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

func (*VMReconciler) ReconcileDeleteVM

func (r *VMReconciler) ReconcileDeleteVM(ctx context.Context, req *VMReqWrapper) error

func (*VMReconciler) ReconcileFixedIP

func (r *VMReconciler) ReconcileFixedIP(ctx context.Context, req *VMReqWrapper) (ctrl.Result, error)

func (*VMReconciler) ReconcilePublicIPBGP

func (r *VMReconciler) ReconcilePublicIPBGP(ctx context.Context, req *VMReqWrapper) error

func (*VMReconciler) ReconcileVM

func (r *VMReconciler) ReconcileVM(ctx context.Context, req *VMReqWrapper) (ctrl.Result, error)

func (*VMReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

func (*VMReconciler) UpdateCRs

func (r *VMReconciler) UpdateCRs(ctx context.Context, req *VMReqWrapper) (ctrl.Result, error)

func (*VMReconciler) UpdateVM

func (r *VMReconciler) UpdateVM(ctx context.Context, req *VMReqWrapper) (ctrl.Result, error)

func (*VMReconciler) UpdateVMNetworks

func (r *VMReconciler) UpdateVMNetworks(ctx context.Context, req *VMReqWrapper) (ctrl.Result, error)

type VMReqWrapper

type VMReqWrapper struct {
	Log    logr.Logger
	Client client.Client
	// contains filtered or unexported fields
}

func NewVMReqWrapper

func NewVMReqWrapper(log logr.Logger, client client.Client) *VMReqWrapper

func (*VMReqWrapper) WithNetworks

func (req *VMReqWrapper) WithNetworks(networks ...*plumberv1.NetworkWizard) *VMReqWrapper

func (*VMReqWrapper) WithVM

Jump to

Keyboard shortcuts

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