network

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2022 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ClusterPrefixAllocationPrefixLabel = "network.onmetal.de/clusterprefix"
)
View Source
const (
	ClusterPrefixFinalizer = "network.onmetal.de/clusterprefix"
)
View Source
const (
	PrefixAllocationIPLabel = "network.onmetal.de/ip"
)
View Source
const (
	PrefixAllocationPrefixLabel = "network.onmetal.de/prefix"
)
View Source
const (
	PrefixFinalizer = "network.onmetal.de/prefix"
)

Variables

This section is empty.

Functions

func CanClusterPrefixFitRequest added in v0.0.9

func CanClusterPrefixFitRequest(clusterPrefix *networkv1alpha1.ClusterPrefix, request networkv1alpha1.PrefixAllocationRequest) bool

func CanIPSetFitRequest added in v0.0.9

func CanIPSetFitRequest(set *netaddr.IPSet, request networkv1alpha1.PrefixAllocationRequest) bool

func CanPrefixFitRequest added in v0.0.9

func CanPrefixFitRequest(prefix *networkv1alpha1.Prefix, request networkv1alpha1.PrefixAllocationRequest) bool

func IPRangeFromIPPlusLength added in v0.0.9

func IPRangeFromIPPlusLength(from netaddr.IP, length int64) (netaddr.IPRange, error)

func IPSetFromNetaddrPrefix added in v0.0.9

func IPSetFromNetaddrPrefix(prefix netaddr.IPPrefix) (*netaddr.IPSet, error)

func IPSetFromPrefixes added in v0.0.9

func IPSetFromPrefixes(prefixes []commonv1alpha1.IPPrefix) (*netaddr.IPSet, error)

func IPSetRemoveFreeRange added in v0.0.9

func IPSetRemoveFreeRange(set *netaddr.IPSet, rngLength int64) (netaddr.IPRange, *netaddr.IPSet, bool)

func IPSetRemovePrefix added in v0.0.9

func IPSetRemovePrefix(set *netaddr.IPSet, prefix netaddr.IPPrefix) (*netaddr.IPSet, bool)

func IPSetRemoveRange added in v0.0.9

func IPSetRemoveRange(set *netaddr.IPSet, rng netaddr.IPRange) (*netaddr.IPSet, bool)

func IsAPINamespaced added in v0.0.9

func IsAPINamespaced(obj runtime.Object, scheme *runtime.Scheme, mapper meta.RESTMapper) (bool, error)

IsAPINamespaced returns true if the object is namespace scoped. For unstructured objects the gvk is found from the object itself.

func IsAPINamespacedWithGVK added in v0.0.9

func IsAPINamespacedWithGVK(gk schema.GroupVersionKind, mapper meta.RESTMapper) (bool, error)

IsAPINamespacedWithGVK returns true if the object having the provided GVK is namespace scoped.

func IsClusterPrefixAllocationFailed added in v0.0.9

func IsClusterPrefixAllocationFailed(allocation *networkv1alpha1.ClusterPrefixAllocation) bool

func IsClusterPrefixAllocationInTerminalState added in v0.0.9

func IsClusterPrefixAllocationInTerminalState(allocation *networkv1alpha1.ClusterPrefixAllocation) bool

func IsClusterPrefixAllocationSucceeded added in v0.0.9

func IsClusterPrefixAllocationSucceeded(allocation *networkv1alpha1.ClusterPrefixAllocation) bool

func IsClusterPrefixReady added in v0.0.9

func IsClusterPrefixReady(prefix *networkv1alpha1.ClusterPrefix) bool

func IsIPReady added in v0.0.9

func IsIPReady(ip *networkv1alpha1.IP) bool

func IsOwned added in v0.0.9

func IsOwned(scheme *runtime.Scheme, owner, controlled client.Object) (bool, error)

func IsPrefixAllocationFailed added in v0.0.9

func IsPrefixAllocationFailed(allocation *networkv1alpha1.PrefixAllocation) bool

func IsPrefixAllocationInTerminalState added in v0.0.9

func IsPrefixAllocationInTerminalState(allocation *networkv1alpha1.PrefixAllocation) bool

func IsPrefixAllocationSucceeded added in v0.0.9

func IsPrefixAllocationSucceeded(allocation *networkv1alpha1.PrefixAllocation) bool

func IsPrefixReady added in v0.0.9

func IsPrefixReady(prefix *networkv1alpha1.Prefix) bool

func IsRootClusterPrefix added in v0.0.9

func IsRootClusterPrefix(prefix *networkv1alpha1.ClusterPrefix) bool

func IsRootPrefix added in v0.0.9

func IsRootPrefix(prefix *networkv1alpha1.Prefix) bool

func ListOwned added in v0.0.9

func ListOwned(ctx context.Context, c client.Client, scheme *runtime.Scheme, owner client.Object, list client.ObjectList, opts ...client.ListOption) error

func PrefixAllocationRequestMatchesAllocator added in v0.0.9

func PrefixAllocationRequestMatchesAllocator(request networkv1alpha1.PrefixAllocationRequest, allocation PrefixAllocationer) bool

func RangeSize added in v0.0.9

func RangeSize(rng netaddr.IPRange) *big.Int

RangeSize computes the number of ips in a range. TODO: we should come up with more efficient arithmetics as the netaddr package does.

func RemoveFreePrefixForRequest added in v0.0.9

func RemoveFreePrefixForRequest(set *netaddr.IPSet, allocation networkv1alpha1.PrefixAllocationRequest) (netaddr.IPPrefix, netaddr.IPRange, *netaddr.IPSet, bool)

func RemoveIntersection added in v0.0.9

func RemoveIntersection(set *netaddr.IPSet, prefix netaddr.IPPrefix) ([]netaddr.IPPrefix, *netaddr.IPSet)

Types

type ClusterPrefix added in v0.0.9

type ClusterPrefix networkv1alpha1.ClusterPrefix

func (*ClusterPrefix) Available added in v0.0.9

func (p *ClusterPrefix) Available() []commonv1alpha1.IPPrefix

func (*ClusterPrefix) Label added in v0.0.9

func (p *ClusterPrefix) Label() string

func (*ClusterPrefix) Object added in v0.0.9

func (p *ClusterPrefix) Object() client.Object

func (*ClusterPrefix) PrefixRef added in v0.0.9

func (*ClusterPrefix) PrefixSelector added in v0.0.9

func (p *ClusterPrefix) PrefixSelector() *networkv1alpha1.PrefixSelector

func (*ClusterPrefix) Request added in v0.0.9

type ClusterPrefixAllocation added in v0.0.9

type ClusterPrefixAllocation networkv1alpha1.ClusterPrefixAllocation

func (*ClusterPrefixAllocation) Object added in v0.0.9

func (*ClusterPrefixAllocation) PrefixRef added in v0.0.9

func (*ClusterPrefixAllocation) ReadyState added in v0.0.9

func (*ClusterPrefixAllocation) Request added in v0.0.9

func (*ClusterPrefixAllocation) Result added in v0.0.9

type ClusterPrefixAllocationSchedulerReconciler added in v0.0.9

type ClusterPrefixAllocationSchedulerReconciler struct {
	client.Client
	Scheme *runtime.Scheme
}

func (*ClusterPrefixAllocationSchedulerReconciler) Reconcile added in v0.0.9

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.

func (*ClusterPrefixAllocationSchedulerReconciler) SetupWithManager added in v0.0.9

type ClusterPrefixReconciler added in v0.0.9

type ClusterPrefixReconciler struct {
	client.Client
	Scheme *runtime.Scheme
}

ClusterPrefixReconciler reconciles a ClusterPrefix object

func (*ClusterPrefixReconciler) Reconcile added in v0.0.9

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

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.

func (*ClusterPrefixReconciler) SetupWithManager added in v0.0.9

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

SetupWithManager sets up the controller with the Manager.

type GatewayReconciler

type GatewayReconciler struct {
	client.Client
	Scheme *runtime.Scheme
}

GatewayReconciler reconciles a Gateway object

func (*GatewayReconciler) Reconcile

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

Reconcile moves the current state of the cluster closer to the desired state.

func (*GatewayReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type IP added in v0.0.9

func (*IP) Label added in v0.0.9

func (i *IP) Label() string

func (*IP) Object added in v0.0.9

func (i *IP) Object() client.Object

func (*IP) PrefixRef added in v0.0.9

func (i *IP) PrefixRef() *networkv1alpha1.PrefixReference

func (*IP) PrefixSelector added in v0.0.9

func (i *IP) PrefixSelector() *networkv1alpha1.PrefixSelector

func (*IP) Request added in v0.0.9

type IPAMRangeReconciler added in v0.0.5

type IPAMRangeReconciler struct {
	client.Client
	Scheme *runtime.Scheme
}

IPAMRangeReconciler reconciles a IPAMRange object

func (*IPAMRangeReconciler) Reconcile added in v0.0.5

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

Reconcile if parent -> handle request part and set range

func (*IPAMRangeReconciler) SetupWithManager added in v0.0.5

func (r *IPAMRangeReconciler) SetupWithManager(mgr manager.Manager) error

SetupWithManager sets up the controller with the Manager.

type IPReconciler added in v0.0.9

type IPReconciler struct {
	client.Client
	Scheme *runtime.Scheme
}

IPReconciler reconciles a IP object

func (*IPReconciler) Reconcile added in v0.0.9

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

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.

func (*IPReconciler) SetupWithManager added in v0.0.9

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

SetupWithManager sets up the controller with the Manager.

type Prefix added in v0.0.9

type Prefix networkv1alpha1.Prefix

func (*Prefix) Available added in v0.0.9

func (p *Prefix) Available() []commonv1alpha1.IPPrefix

func (*Prefix) Label added in v0.0.9

func (p *Prefix) Label() string

func (*Prefix) Object added in v0.0.9

func (p *Prefix) Object() client.Object

func (*Prefix) PrefixRef added in v0.0.9

func (p *Prefix) PrefixRef() *networkv1alpha1.PrefixReference

func (*Prefix) PrefixSelector added in v0.0.9

func (p *Prefix) PrefixSelector() *networkv1alpha1.PrefixSelector

func (*Prefix) Request added in v0.0.9

type PrefixAllocation added in v0.0.9

type PrefixAllocation networkv1alpha1.PrefixAllocation

func (*PrefixAllocation) Object added in v0.0.9

func (p *PrefixAllocation) Object() client.Object

func (*PrefixAllocation) PrefixRef added in v0.0.9

func (*PrefixAllocation) ReadyState added in v0.0.9

func (*PrefixAllocation) Request added in v0.0.9

func (*PrefixAllocation) Result added in v0.0.9

type PrefixAllocationReadyState added in v0.0.9

type PrefixAllocationReadyState int8
const (
	PrefixAllocationFailed PrefixAllocationReadyState = iota - 1
	PrefixAllocationUnknown
	PrefixAllocationPending
	PrefixAllocationSucceeded
)

type PrefixAllocationSchedulerReconciler added in v0.0.9

type PrefixAllocationSchedulerReconciler struct {
	client.Client
	Scheme *runtime.Scheme
}

func (*PrefixAllocationSchedulerReconciler) Reconcile added in v0.0.9

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.

func (*PrefixAllocationSchedulerReconciler) SetupWithManager added in v0.0.9

func (r *PrefixAllocationSchedulerReconciler) SetupWithManager(mgr manager.Manager) error

type PrefixAllocationer added in v0.0.9

type PrefixAllocationer interface {
	Object() client.Object
	PrefixRef() *networkv1alpha1.PrefixReference
	Request() networkv1alpha1.PrefixAllocationRequest
	Result() networkv1alpha1.PrefixAllocationResult
	ReadyState() PrefixAllocationReadyState
}

func CreateAllocator added in v0.0.9

func CreateAllocator(scheme *runtime.Scheme, mapper meta.RESTMapper, requester PrefixRequester) (PrefixAllocationer, error)

type PrefixAllocator added in v0.0.9

type PrefixAllocator struct {
	client.Client
	Scheme *runtime.Scheme
}

func NewPrefixAllocator added in v0.0.9

func NewPrefixAllocator(c client.Client, scheme *runtime.Scheme) *PrefixAllocator

func (*PrefixAllocator) Apply added in v0.0.9

type PrefixReconciler added in v0.0.9

type PrefixReconciler struct {
	client.Client
	Scheme *runtime.Scheme
}

PrefixReconciler reconciles a Prefix object

func (*PrefixReconciler) Reconcile added in v0.0.9

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

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.

func (*PrefixReconciler) SetupWithManager added in v0.0.9

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

SetupWithManager sets up the controller with the Manager.

type PrefixRequester added in v0.0.9

type PrefixRequester interface {
	Object() client.Object
	Label() string
	Request() networkv1alpha1.PrefixAllocationRequest
	PrefixRef() *networkv1alpha1.PrefixReference
	PrefixSelector() *networkv1alpha1.PrefixSelector
}

type Prefixer added in v0.0.9

type Prefixer interface {
	Object() client.Object
	Available() []commonv1alpha1.IPPrefix
}

type ReservedIPReconciler added in v0.0.4

type ReservedIPReconciler struct {
	client.Client
	Scheme *runtime.Scheme
}

ReservedIPReconciler reconciles a ReservedIP object

func (*ReservedIPReconciler) Reconcile added in v0.0.4

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

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.

func (*ReservedIPReconciler) SetupWithManager added in v0.0.4

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

SetupWithManager sets up the controller with the Manager.

type RoutingDomainReconciler added in v0.0.5

type RoutingDomainReconciler struct {
	client.Client
	Scheme *runtime.Scheme
}

RoutingDomainReconciler reconciles a RoutingDomain object

func (*RoutingDomainReconciler) Reconcile added in v0.0.5

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

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state. TODO(user): Modify the Reconcile function to compare the state specified by the RoutingDomain object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.8.3/pkg/reconcile

func (*RoutingDomainReconciler) SetupWithManager added in v0.0.5

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

SetupWithManager sets up the controller with the Manager.

type SecurityGroupReconciler

type SecurityGroupReconciler struct {
	client.Client
	Scheme *runtime.Scheme
}

SecurityGroupReconciler reconciles a SecurityGroup object

func (*SecurityGroupReconciler) Reconcile

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

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state. TODO(user): Modify the Reconcile function to compare the state specified by the SecurityGroup object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.8.3/pkg/reconcile

func (*SecurityGroupReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type SubnetReconciler

type SubnetReconciler struct {
	client.Client
	Scheme *runtime.Scheme
}

SubnetReconciler reconciles a Subnet object

func (*SubnetReconciler) Reconcile

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

Reconcile reconciles the spec with the real world.

func (*SubnetReconciler) SetupWithManager

func (r *SubnetReconciler) SetupWithManager(mgr manager.Manager) error

SetupWithManager sets up the controller with the Manager.

Jump to

Keyboard shortcuts

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