configurationcontroller

package
v0.11.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package configurationcontroller contains the logic to manage the Configuration resource.

Index

Constants

View Source
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"
)
View Source
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

LabelCIDRTypeValues is the list of all the possible values of the LabelCIDRType label.

Functions

func CreateOrGetNetwork

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

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"
)

Jump to

Keyboard shortcuts

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