Documentation ¶
Overview ¶
Package configurationcontroller contains the logic to manage the Configuration resource.
Index ¶
- Constants
- Variables
- func CreateOrGetNetwork(ctx context.Context, cl client.Client, scheme *runtime.Scheme, ...) (*ipamv1alpha1.Network, error)
- func ForgeConfigurationStatus(cfg *networkingv1alpha1.Configuration, net *ipamv1alpha1.Network, ...)
- func ForgeNetwork(net *ipamv1alpha1.Network, cfg *networkingv1alpha1.Configuration, ...) (err error)
- func ForgeNetworkLabel(cfg *networkingv1alpha1.Configuration, cidrType LabelCIDRTypeValue) (netLabels map[string]string, err error)
- func ForgeNetworkLabelSelector(cfg *networkingv1alpha1.Configuration, cidrType LabelCIDRTypeValue) (labelsSelector labels.Selector, err error)
- func ForgeNetworkMetadata(net *ipamv1alpha1.Network, cfg *networkingv1alpha1.Configuration, ...) error
- func SetConfigurationConfigured(ctx context.Context, cl client.Client, cfg *networkingv1alpha1.Configuration) error
- type ConfigurationReconciler
- func (r *ConfigurationReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (r *ConfigurationReconciler) RemapConfiguration(ctx context.Context, cfg *networkingv1alpha1.Configuration, ...) error
- func (r *ConfigurationReconciler) SetupWithManager(mgr ctrl.Manager) error
- func (r *ConfigurationReconciler) UpdateConfigurationStatus(ctx context.Context, cfg *networkingv1alpha1.Configuration) error
- type LabelCIDRTypeValue
Constants ¶
const ( // Configured is the label used to mark a configuration as configured. Configured = "configuration.liqo.io/configured" // ConfiguredValue is the value of the Configured label. ConfiguredValue = "true" )
const LabelCIDRType = "configuration.liqo.io/cidr-type"
LabelCIDRType is the label used to target a ipamv1alpha1.Network resource that manages a PodCIDR or an ExternalCIDR.
Variables ¶
var LabelCIDRTypeValues = []LabelCIDRTypeValue{LabelCIDRTypePod, LabelCIDRTypeExternal}
LabelCIDRTypeValues is the list of all the possible values of the LabelCIDRType label.
Functions ¶
func CreateOrGetNetwork ¶
func CreateOrGetNetwork(ctx context.Context, cl client.Client, scheme *runtime.Scheme, er record.EventRecorder, cfg *networkingv1alpha1.Configuration, cidrType LabelCIDRTypeValue) (*ipamv1alpha1.Network, error)
CreateOrGetNetwork creates or gets a ipamv1alpha1.Network resource.
func ForgeConfigurationStatus ¶
func ForgeConfigurationStatus(cfg *networkingv1alpha1.Configuration, net *ipamv1alpha1.Network, cidrType LabelCIDRTypeValue)
ForgeConfigurationStatus create the status of the configuration.
func ForgeNetwork ¶
func ForgeNetwork(net *ipamv1alpha1.Network, cfg *networkingv1alpha1.Configuration, cidrType LabelCIDRTypeValue, scheme *runtime.Scheme) (err error)
ForgeNetwork creates a ipamv1alpha1.Network resource.
func ForgeNetworkLabel ¶
func ForgeNetworkLabel(cfg *networkingv1alpha1.Configuration, cidrType LabelCIDRTypeValue) (netLabels map[string]string, err error)
ForgeNetworkLabel creates a label to target a ipamv1alpha1.Network resource. The label is composed by the remote cluster ID and the CIDR type.
func ForgeNetworkLabelSelector ¶
func ForgeNetworkLabelSelector(cfg *networkingv1alpha1.Configuration, cidrType LabelCIDRTypeValue) (labelsSelector labels.Selector, err error)
ForgeNetworkLabelSelector creates a labels.Selector to target a ipamv1alpha1.Network resource. The label is composed by the remote cluster ID and the CIDR type.
func ForgeNetworkMetadata ¶
func ForgeNetworkMetadata(net *ipamv1alpha1.Network, cfg *networkingv1alpha1.Configuration, cidrType LabelCIDRTypeValue) error
ForgeNetworkMetadata creates the metadata of a ipamv1alpha1.Network resource.
func SetConfigurationConfigured ¶
func SetConfigurationConfigured(ctx context.Context, cl client.Client, cfg *networkingv1alpha1.Configuration) error
SetConfigurationConfigured sets the Configured label of the given configuration to true.
Types ¶
type ConfigurationReconciler ¶
type ConfigurationReconciler struct { client.Client Scheme *runtime.Scheme EventsRecorder record.EventRecorder // contains filtered or unexported fields }
ConfigurationReconciler manage Configuration lifecycle.
func NewConfigurationReconciler ¶
func NewConfigurationReconciler(cl client.Client, s *runtime.Scheme, er record.EventRecorder, ipamClient ipam.IpamClient) *ConfigurationReconciler
NewConfigurationReconciler returns a new ConfigurationReconciler.
func (*ConfigurationReconciler) Reconcile ¶
func (r *ConfigurationReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
Reconcile manage Configurations, remapping cidrs with Networks resources.
func (*ConfigurationReconciler) RemapConfiguration ¶
func (r *ConfigurationReconciler) RemapConfiguration(ctx context.Context, cfg *networkingv1alpha1.Configuration, er record.EventRecorder) error
RemapConfiguration remap the configuration using ipamv1alpha1.Network.
func (*ConfigurationReconciler) SetupWithManager ¶
func (r *ConfigurationReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager register the ConfigurationReconciler to the manager.
func (*ConfigurationReconciler) UpdateConfigurationStatus ¶
func (r *ConfigurationReconciler) UpdateConfigurationStatus(ctx context.Context, cfg *networkingv1alpha1.Configuration) error
UpdateConfigurationStatus update the configuration.
type LabelCIDRTypeValue ¶
type LabelCIDRTypeValue string
LabelCIDRTypeValue is the value of the LabelCIDRType label.
const ( // LabelCIDRTypePod is used to target a ipamv1alpha1.Network resource that manages a PodCIDR. LabelCIDRTypePod LabelCIDRTypeValue = "pod" // LabelCIDRTypeExternal is used to target a ipamv1alpha1.Network resource that manages an ExternalCIDR. LabelCIDRTypeExternal LabelCIDRTypeValue = "external" )