controllers

package
v0.0.0-...-bc5a0fe Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const AddressPoolControllerName = "addresspool-controller"
View Source
const AddressPoolFinalizerName = "addresspool.finalizers.windriver.com"
View Source
const (
	// Defines commonly used network allocation type values.
	AllocationTypeDynamic = "dynamic"
)
View Source
const DataNetworkControllerName = "datanetwork-controller"
View Source
const DataNetworkFinalizerName = "datanetwork.finalizers.windriver.com"
View Source
const HostProfileControllerName = "hostprofile-controller"
View Source
const PlatformNetworkControllerName = "platformnetwork-controller"
View Source
const PlatformNetworkFinalizerName = "platformnetwork.finalizers.windriver.com"
View Source
const PtpInstanceControllerName = "ptpinstance-controller"
View Source
const PtpInstanceFinalizerName = "ptpinstance.finalizers.windriver.com"
View Source
const PtpInterfaceControllerName = "ptpinterface-controller"
View Source
const PtpInterfaceFinalizerName = "ptpinterface.finalizers.windriver.com"

Variables

View Source
var AddToManagerFuncs []func(manager.Manager) error

AddToManagerFuncs is a list of functions to add all Controllers to the Manager

Functions

func AddToManager

func AddToManager(m manager.Manager) error

AddToManager adds all Controllers to the Manager

Types

type AddressPoolReconciler

AddressPoolReconciler reconciles a AddressPool object

func (*AddressPoolReconciler) ClearRestoreInProgress

func (r *AddressPoolReconciler) ClearRestoreInProgress(instance *starlingxv1.AddressPool) error

Clear annotation RestoreInProgress

func (*AddressPoolReconciler) Reconcile

func (r *AddressPoolReconciler) Reconcile(ctx context.Context, request ctrl.Request) (ctrl.Result, error)

Reconcile reads that state of the cluster for a AddressPool object and makes changes based on the state read +kubebuilder:rbac:groups=starlingx.windriver.com,resources=addresspools,verbs=get;list;watch;create;update;patch;delete +kubebuilder:rbac:groups=starlingx.windriver.com,resources=addresspools/status,verbs=get;update;patch +kubebuilder:rbac:groups=starlingx.windriver.com,resources=addresspools/finalizers,verbs=update

func (*AddressPoolReconciler) ReconcileResource

func (r *AddressPoolReconciler) ReconcileResource(client *gophercloud.ServiceClient, instance *starlingxv1.AddressPool, request_namespace string) (err error)

Fetch active controller's host instance and increment annotation value of deployment-manager/notifications only if Generation != ObservedGeneration or there is a deploymentScope change. Note that for deletion we are just cleaning up the finalizer and we are not specifically deleting addresspool object on the system.

func (*AddressPoolReconciler) RestoreAddressPoolStatus

func (r *AddressPoolReconciler) RestoreAddressPoolStatus(instance *starlingxv1.AddressPool) error

Updates the AddressPool status while restoring

func (*AddressPoolReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

func (*AddressPoolReconciler) UpdateInsyncStatus

func (r *AddressPoolReconciler) UpdateInsyncStatus(client *gophercloud.ServiceClient, instance *starlingxv1.AddressPool, oldStatus *starlingxv1.AddressPoolStatus) error

type DataNetworkReconciler

DataNetworkReconciler reconciles a DataNetwork object

func (*DataNetworkReconciler) ClearRestoreInProgress

func (r *DataNetworkReconciler) ClearRestoreInProgress(instance *starlingxv1.DataNetwork) error

Clear annotation RestoreInProgress

func (*DataNetworkReconciler) FindExistingResource

func (r *DataNetworkReconciler) FindExistingResource(client *gophercloud.ServiceClient, instance *starlingxv1.DataNetwork) (network *datanetworks.DataNetwork, err error)

FindExistingResource attempts to re-use the existing resource referenced by the ID value stored in the status or to find another resource with a matching name.

func (*DataNetworkReconciler) Reconcile

func (r *DataNetworkReconciler) Reconcile(ctx context.Context, request ctrl.Request) (ctrl.Result, error)

Reconcile reads that state of the cluster for a DataNetwork object and makes changes based on the state read +kubebuilder:rbac:groups=starlingx.windriver.com,resources=datanetworks,verbs=get;list;watch;create;update;patch;delete +kubebuilder:rbac:groups=starlingx.windriver.com,resources=datanetworks/status,verbs=get;update;patch +kubebuilder:rbac:groups=starlingx.windriver.com,resources=datanetworks/finalizers,verbs=update

func (*DataNetworkReconciler) ReconcileNew

ReconcileNew is a method which handles reconciling a new data resource and creates the corresponding system resource thru the system API.

func (*DataNetworkReconciler) ReconcileResource

func (r *DataNetworkReconciler) ReconcileResource(client *gophercloud.ServiceClient, instance *starlingxv1.DataNetwork) error

ReconcileResource interacts with the system API in order to reconcile the state of a data network with the state stored in the k8s database.

func (*DataNetworkReconciler) ReconcileUpdated

func (r *DataNetworkReconciler) ReconcileUpdated(client *gophercloud.ServiceClient, instance *starlingxv1.DataNetwork, network *datanetworks.DataNetwork) error

ReconcileUpdated is a method which handles reconciling an existing data resource and updates the corresponding system resource thru the system API to match the desired state of the resource.

func (*DataNetworkReconciler) ReconciledDeleted

func (r *DataNetworkReconciler) ReconciledDeleted(client *gophercloud.ServiceClient, instance *starlingxv1.DataNetwork, network *datanetworks.DataNetwork) error

ReconcileNew is a method which handles reconciling a new data resource and creates the corresponding system resource thru the system API.

func (*DataNetworkReconciler) RestoreDataNetworkStatus

func (r *DataNetworkReconciler) RestoreDataNetworkStatus(instance *starlingxv1.DataNetwork) error

Update status

func (*DataNetworkReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

func (*DataNetworkReconciler) StopAfterInSync

func (r *DataNetworkReconciler) StopAfterInSync() bool

StopAfterInSync determines whether the reconciler should continue processing change requests after the configuration has been reconciled a first time.

func (*DataNetworkReconciler) UpdateConfigStatus

func (r *DataNetworkReconciler) UpdateConfigStatus(instance *starlingxv1.DataNetwork, ns string) (err error)

Update ReconcileAfterInSync in instance ReconcileAfterInSync value will be: "true" if deploymentScope is "principal" because it is day 2 operation (update configuration) "false" if deploymentScope is "bootstrap" Then reflect these values to cluster object It is expected that instance.Status.Deployment scope is already updated by UpdateDeploymentScope at this point.

func (*DataNetworkReconciler) UpdateDeploymentScope

func (r *DataNetworkReconciler) UpdateDeploymentScope(instance *starlingxv1.DataNetwork) (error, bool)

UpdateDeploymentScope function is used to update the deployment scope for DataNetwork.

func (*DataNetworkReconciler) UpdateStatusForFactoryInstall

func (r *DataNetworkReconciler) UpdateStatusForFactoryInstall(
	ns string,
	instance *starlingxv1.DataNetwork,
) error

During factory install, the reconciled status is expected to be updated to false to unblock the configuration as the day 1 configuration. UpdateStatusForFactoryInstall updates the status by checking the factory install data.

type HostProfileReconciler

type HostProfileReconciler struct {
	client.Client
	Log    logr.Logger
	Scheme *runtime.Scheme
	common.ReconcilerEventLogger
}

HostProfileReconciler reconciles a HostProfile object

func (*HostProfileReconciler) ProfileUses

func (r *HostProfileReconciler) ProfileUses(namespace, base, target string) (bool, error)

ProfileUses determines whether the 'base' profile references the 'target' profile either directly or indirectly via one of its parent/base profiles.

func (*HostProfileReconciler) Reconcile

func (r *HostProfileReconciler) Reconcile(ctx context.Context, request ctrl.Request) (ctrl.Result, error)

Reconcile reads that state of the cluster for a HostProfile object and makes changes based on the state read and what is in the HostProfile.Spec +kubebuilder:rbac:groups=starlingx.windriver.com,resources=hostprofiles,verbs=get;list;watch;create;update;patch;delete +kubebuilder:rbac:groups=starlingx.windriver.com,resources=hostprofiles/status,verbs=get;update;patch +kubebuilder:rbac:groups=starlingx.windriver.com,resources=hostprofiles/finalizers,verbs=update

func (*HostProfileReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

func (*HostProfileReconciler) UpdateHosts

func (r *HostProfileReconciler) UpdateHosts(instance *starlingxv1.HostProfile) error

UpdateHosts will force a update to each host that references this profile. This is to ensure that hosts get reconciled whenever any of their profiles get updated.

type PlatformNetworkReconciler

PlatformNetworkReconciler reconciles a PlatformNetwork object

func (*PlatformNetworkReconciler) ClearRestoreInProgress

func (r *PlatformNetworkReconciler) ClearRestoreInProgress(instance *starlingxv1.PlatformNetwork) error

Clear annotation RestoreInProgress

func (*PlatformNetworkReconciler) Reconcile

func (r *PlatformNetworkReconciler) Reconcile(ctx context.Context, request ctrl.Request) (ctrl.Result, error)

Reconcile reads that state of the cluster for a PlatformNetwork object and makes changes based on the state read +kubebuilder:rbac:groups=starlingx.windriver.com,resources=platformnetworks,verbs=get;list;watch;create;update;patch;delete +kubebuilder:rbac:groups=starlingx.windriver.com,resources=platformnetworks/status,verbs=get;update;patch +kubebuilder:rbac:groups=starlingx.windriver.com,resources=platformnetworks/finalizers,verbs=update

func (*PlatformNetworkReconciler) ReconcileResource

func (r *PlatformNetworkReconciler) ReconcileResource(client *gophercloud.ServiceClient, instance *starlingxv1.PlatformNetwork, reqNs string, scope_updated bool) (err error)

Fetch active controller's host instance and increment annotation value of deployment-manager/notifications only if Generation != ObservedGeneration or there is a deploymentScope change. Note that for deletion we are just cleaning up the finalizer and we are not specifically deleting network object on the system.

func (*PlatformNetworkReconciler) RestorePlatformNetworkStatus

func (r *PlatformNetworkReconciler) RestorePlatformNetworkStatus(instance *starlingxv1.PlatformNetwork) error

Update status

func (*PlatformNetworkReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

func (*PlatformNetworkReconciler) StopAfterInSync

func (r *PlatformNetworkReconciler) StopAfterInSync() bool

StopAfterInSync determines whether the reconciler should continue processing change requests after the configuration has been reconciled a first time.

func (*PlatformNetworkReconciler) UpdateConfigStatus

func (r *PlatformNetworkReconciler) UpdateConfigStatus(instance *starlingxv1.PlatformNetwork, ns string) (err error)

Update ReconcileAfterInSync in instance ReconcileAfterInSync value will be: "true" if deploymentScope is "principal" because it is day 2 operation (update configuration) "false" if deploymentScope is "bootstrap" Then reflect these values to cluster object It is expected that instance.Status.Deployment scope is already updated by UpdateDeploymentScope at this point.

func (*PlatformNetworkReconciler) UpdateDeploymentScope

func (r *PlatformNetworkReconciler) UpdateDeploymentScope(instance *starlingxv1.PlatformNetwork) (error, bool)

UpdateDeploymentScope function is used to update the deployment scope for PlatformNetwork.

func (*PlatformNetworkReconciler) UpdateInsyncStatus

func (*PlatformNetworkReconciler) UpdateStatusForFactoryInstall

func (r *PlatformNetworkReconciler) UpdateStatusForFactoryInstall(
	ns string,
	instance *starlingxv1.PlatformNetwork,
) error

During factory install, the reconciled status is expected to be updated to false to unblock the configuration as the day 1 configuration. UpdateStatusForFactoryInstall updates the status by checking the factory install data.

type PtpInstanceReconciler

PtpInstanceReconciler reconciles a PtpInstance object

func (*PtpInstanceReconciler) ClearRestoreInProgress

func (r *PtpInstanceReconciler) ClearRestoreInProgress(instance *starlingxv1.PtpInstance) error

Clear annotation RestoreInProgress

func (*PtpInstanceReconciler) FindExistingPTPInstance

func (r *PtpInstanceReconciler) FindExistingPTPInstance(client *gophercloud.ServiceClient, instance *starlingxv1.PtpInstance) (found *ptpinstances.PTPInstance, err error)

FindExistingPTPInstance attempts to find the existing PTP instance referenced by the ID value stored in the status or to find another resource with a matching name.

func (*PtpInstanceReconciler) Reconcile

func (r *PtpInstanceReconciler) Reconcile(ctx context.Context, request ctrl.Request) (ctrl.Result, error)

Reconcile reads that state of the cluster for a PTPInstance object and makes changes based on the state read and what is in the PtpInstance.Spec +kubebuilder:rbac:groups=starlingx.windriver.com,resources=ptpinstances,verbs=get;list;watch;create;update;patch;delete +kubebuilder:rbac:groups=starlingx.windriver.com,resources=ptpinstances/status,verbs=get;update;patch +kubebuilder:rbac:groups=starlingx.windriver.com,resources=ptpinstances/finalizers,verbs=update

func (*PtpInstanceReconciler) ReconcileNew

ReconcileNew is a method which handles reconciling a new data resource and creates the corresponding system resource thru the system API.

func (*PtpInstanceReconciler) ReconcileParamAdded

ReconcileParamAdded is a method which handles adding new Parameters to associate with an existing PTP instance

func (*PtpInstanceReconciler) ReconcileParamRemoved

func (r *PtpInstanceReconciler) ReconcileParamRemoved(client *gophercloud.ServiceClient, params []string, i *ptpinstances.PTPInstance) (*ptpinstances.PTPInstance, error)

ReconcileParamAdded is a method which handles removing new Parameters from an existing PTP instance

func (*PtpInstanceReconciler) ReconcileResource

func (r *PtpInstanceReconciler) ReconcileResource(client *gophercloud.ServiceClient, instance *starlingxv1.PtpInstance) error

ReconcileResource interacts with the system API in order to reconcile the state of a ptp instance with the state stored in the k8s database.

func (*PtpInstanceReconciler) ReconcileUpdated

func (r *PtpInstanceReconciler) ReconcileUpdated(client *gophercloud.ServiceClient, instance *starlingxv1.PtpInstance, existing *ptpinstances.PTPInstance) error

ReconcileUpdated is a method which handles reconciling an existing data resource and updates the corresponding system resource thru the system API to match the desired state of the resource.

func (*PtpInstanceReconciler) ReconciledDeleted

ReconciledDeleted is a method which handles reconciling a new data resource and creates the corresponding system resource thru the system API.

func (*PtpInstanceReconciler) RestorePtpInstanceStatus

func (r *PtpInstanceReconciler) RestorePtpInstanceStatus(instance *starlingxv1.PtpInstance) error

Update status

func (*PtpInstanceReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

func (*PtpInstanceReconciler) StopAfterInSync

func (r *PtpInstanceReconciler) StopAfterInSync() bool

StopAfterInSync determines whether the reconciler should continue processing change requests after the configuration has been reconciled a first time.

func (*PtpInstanceReconciler) UpdateConfigStatus

func (r *PtpInstanceReconciler) UpdateConfigStatus(instance *starlingxv1.PtpInstance, ns string) (err error)

Update ReconcileAfterInSync in instance ReconcileAfterInSync value will be: "true" if deploymentScope is "principal" because it is day 2 operation (update configuration) "false" if deploymentScope is "bootstrap" Then reflect these values to cluster object It is expected that instance.Status.Deployment scope is already updated by UpdateDeploymentScope at this point.

func (*PtpInstanceReconciler) UpdateDeploymentScope

func (r *PtpInstanceReconciler) UpdateDeploymentScope(instance *starlingxv1.PtpInstance) (error, bool)

UpdateDeploymentScope function is used to update the deployment scope for PtpInstance.

func (*PtpInstanceReconciler) UpdateStatusForFactoryInstall

func (r *PtpInstanceReconciler) UpdateStatusForFactoryInstall(
	ns string,
	instance *starlingxv1.PtpInstance,
) error

During factory install, the reconciled status is expected to be updated to false to unblock the configuration as the day 1 configuration. UpdateStatusForFactoryInstall updates the status by checking the factory install data.

type PtpInterfaceReconciler

PtpInterfaceReconciler reconciles a PtpInterface object

func (*PtpInterfaceReconciler) ClearRestoreInProgress

func (r *PtpInterfaceReconciler) ClearRestoreInProgress(instance *starlingxv1.PtpInterface) error

Clear annotation RestoreInProgress

func (*PtpInterfaceReconciler) FindExistingPTPInterface

func (r *PtpInterfaceReconciler) FindExistingPTPInterface(client *gophercloud.ServiceClient, instance *starlingxv1.PtpInterface) (found *ptpinterfaces.PTPInterface, err error)

FindExistingPTPInterface attempts to find the existing PTP interface referenced by the ID value stored in the status or to find another resource with a matching name.

func (*PtpInterfaceReconciler) Reconcile

func (r *PtpInterfaceReconciler) Reconcile(ctx context.Context, request ctrl.Request) (ctrl.Result, error)

Reconcile reads that state of the cluster for a PTPInterface object and makes changes based on the state read and what is in the PtpInterface.Spec +kubebuilder:rbac:groups=starlingx.windriver.com,resources=ptpinterfaces,verbs=get;list;watch;create;update;patch;delete +kubebuilder:rbac:groups=starlingx.windriver.com,resources=ptpinterfaces/status,verbs=get;update;patch +kubebuilder:rbac:groups=starlingx.windriver.com,resources=ptpinterfaces/finalizers,verbs=update

func (*PtpInterfaceReconciler) ReconcileNew

ReconcileNew is a method which handles reconciling a new data resource and creates the corresponding system resource thru the system API.

func (*PtpInterfaceReconciler) ReconcileParamAdded

ReconcileParamAdded is a method which handles adding new Parameters to associate with an existing PTP interface

func (*PtpInterfaceReconciler) ReconcileParamRemoved

ReconcileParamRemoved is a method which handles removing Parameters from an existing PTP

func (*PtpInterfaceReconciler) ReconcileResource

func (r *PtpInterfaceReconciler) ReconcileResource(client *gophercloud.ServiceClient, instance *starlingxv1.PtpInterface) error

ReconcileResource interacts with the system API in order to reconcile the state of a PTP interface with the state stored in the k8s database.

func (*PtpInterfaceReconciler) ReconcileUpdated

func (r *PtpInterfaceReconciler) ReconcileUpdated(client *gophercloud.ServiceClient, instance *starlingxv1.PtpInterface, existing *ptpinterfaces.PTPInterface) error

ReconcileUpdated is a method which handles reconciling an existing data resource and updates the corresponding system resource thru the system API to match the desired state of the resource.

func (*PtpInterfaceReconciler) ReconciledDeleted

ReconciledDeleted is a method which handles reconciling a new data resource and creates the corresponding system resource thru the system API.

func (*PtpInterfaceReconciler) RestorePtpinterfaceStatus

func (r *PtpInterfaceReconciler) RestorePtpinterfaceStatus(instance *starlingxv1.PtpInterface) error

Update status

func (*PtpInterfaceReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

func (*PtpInterfaceReconciler) StopAfterInSync

func (r *PtpInterfaceReconciler) StopAfterInSync() bool

StopAfterInSync determines whether the reconciler should continue processing change requests after the configuration has been reconciled a first time.

func (*PtpInterfaceReconciler) UpdateConfigStatus

func (r *PtpInterfaceReconciler) UpdateConfigStatus(instance *starlingxv1.PtpInterface, ns string) (err error)

Update ReconcileAfterInSync in instance ReconcileAfterInSync value will be: "true" if deploymentScope is "principal" because it is day 2 operation (update configuration) "false" if deploymentScope is "bootstrap" Then reflect these values to cluster object It is expected that instance.Status.Deployment scope is already updated by UpdateDeploymentScope at this point.

func (*PtpInterfaceReconciler) UpdateDeploymentScope

func (r *PtpInterfaceReconciler) UpdateDeploymentScope(instance *starlingxv1.PtpInterface) (error, bool)

UpdateDeploymentScope function is used to update the deployment scope for PtpInterface.

func (*PtpInterfaceReconciler) UpdateStatusForFactoryInstall

func (r *PtpInterfaceReconciler) UpdateStatusForFactoryInstall(
	ns string,
	instance *starlingxv1.PtpInterface,
) error

During factory install, the reconciled status is expected to be updated to false to unblock the configuration as the day 1 configuration. UpdateStatusForFactoryInstall updates the status by checking the factory install data.

Directories

Path Synopsis
SPDX-License-Identifier: Apache-2.0 Copyright(c) 2024 Wind River Systems, Inc.
SPDX-License-Identifier: Apache-2.0 Copyright(c) 2024 Wind River Systems, Inc.

Jump to

Keyboard shortcuts

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