Documentation
¶
Index ¶
- Constants
- func ApplyObject(ctx context.Context, client client.Client, obj *uns.Unstructured) error
- func DeleteObject(ctx context.Context, client client.Client, obj *uns.Unstructured) error
- func IsObjectSupported(obj *uns.Unstructured) error
- func MergeDeploymentForUpdate(current, updated *uns.Unstructured) error
- func MergeMetadataForUpdate(current, updated *uns.Unstructured) error
- func MergeObjectForUpdate(current, updated *uns.Unstructured) error
- func MergeServiceAccountForUpdate(current, updated *uns.Unstructured) error
- func MergeServiceForUpdate(current, updated *uns.Unstructured) error
- func ReturnPatchedVM(vm *kubevirtv1.VirtualMachine, req admission.Request) admission.Response
- type DeployCtx
- type NetReqWrapper
- type NetworkWizardReconciler
- func (r *NetworkWizardReconciler) GetVMsForNetwork(network *plumberv1.NetworkWizard) ([]*kubevirtv1.VirtualMachine, error)
- func (r *NetworkWizardReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (r *NetworkWizardReconciler) ReconcileDelete(ctx context.Context, req *NetReqWrapper) error
- func (r *NetworkWizardReconciler) ReconcileNetwork(ctx context.Context, req *NetReqWrapper) (ctrl.Result, error)
- func (r *NetworkWizardReconciler) SetupWithManager(mgr ctrl.Manager) error
- type VMAnnotator
- type VMReconciler
- func (r *VMReconciler) DeleteIPAllocationsForVM(ctx context.Context, req *VMReqWrapper) error
- func (r *VMReconciler) GetNetworksForVM(ctx context.Context, req *VMReqWrapper) ([]*plumberv1.NetworkWizard, error)
- func (r *VMReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (r *VMReconciler) ReconcileDeleteVM(ctx context.Context, req *VMReqWrapper) error
- func (r *VMReconciler) ReconcileFixedIP(ctx context.Context, req *VMReqWrapper) (ctrl.Result, error)
- func (r *VMReconciler) ReconcilePublicIPBGP(ctx context.Context, req *VMReqWrapper) error
- func (r *VMReconciler) ReconcileVM(ctx context.Context, req *VMReqWrapper) (ctrl.Result, error)
- func (r *VMReconciler) SetupWithManager(mgr ctrl.Manager) error
- func (r *VMReconciler) UpdateCRs(ctx context.Context, req *VMReqWrapper) (ctrl.Result, error)
- func (r *VMReconciler) UpdateVM(ctx context.Context, req *VMReqWrapper) (ctrl.Result, error)
- func (r *VMReconciler) UpdateVMNetworks(ctx context.Context, req *VMReqWrapper) (ctrl.Result, error)
- type VMReqWrapper
Constants ¶
const DeploymentWaitTimeout = 60
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 ¶
ApplyObject applies the desired object against the apiserver, merging it with any existing objects if already present.
func DeleteObject ¶
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
func ReturnPatchedVM ¶
func ReturnPatchedVM(vm *kubevirtv1.VirtualMachine, req admission.Request) admission.Response
Types ¶
type DeployCtx ¶
type DeployCtx struct { Client client.Client Log logr.Logger // contains filtered or unexported fields }
func (*DeployCtx) DeployDependencies ¶
func (*DeployCtx) GetDeployment ¶
func (ctx *DeployCtx) GetDeployment(name, namespace string) (*appsv1.Deployment, 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 ¶
NetworkWizardReconciler reconciles a NetworkWizard object
func (*NetworkWizardReconciler) GetVMsForNetwork ¶
func (r *NetworkWizardReconciler) GetVMsForNetwork(network *plumberv1.NetworkWizard) ([]*kubevirtv1.VirtualMachine, 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 ¶
func (*VMAnnotator) InjectDecoder ¶
func (a *VMAnnotator) InjectDecoder(d *admission.Decoder) error
type VMReconciler ¶
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) 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 ¶
func (req *VMReqWrapper) WithVM(vm *kubevirtv1.VirtualMachine) *VMReqWrapper