utils

package
v0.8.5 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2023 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ParseNetworkConfigOfPodByPriority = utils.ParseNetworkConfigOfPodByPriority
View Source
var (
	ToDNSFormat = utils.ToDNSFormat
)

Functions

func CheckObjectExistence added in v0.7.0

func CheckObjectExistence(ctx context.Context, c client.Reader, namespacedName types.NamespacedName, obj client.Object) (bool, error)

func DetectNetworkAttachmentOfNode

func DetectNetworkAttachmentOfNode(ctx context.Context, client client.Reader, node *corev1.Node) (underlayAttached, overlayAttached bool, err error)

func FindBGPUnderlayNetworkForNode added in v0.5.0

func FindBGPUnderlayNetworkForNode(ctx context.Context, client client.Reader, nodeLabels map[string]string) (underlayNetworkName string, err error)

func FindGlobalBGPNetwork added in v0.5.0

func FindGlobalBGPNetwork(ctx context.Context, client client.Reader) (globalBGPNetworkName string, err error)

func FindOverlayNetwork

func FindOverlayNetwork(ctx context.Context, client client.Reader) (overlayNetworkName string, err error)

func FindOverlayNetworkNetID

func FindOverlayNetworkNetID(ctx context.Context, client client.Reader) (*int32, error)

func FindUnderlayNetworkForNode

func FindUnderlayNetworkForNode(ctx context.Context, client client.Reader, nodeLabels map[string]string) (underlayNetworkName string, err error)

func FindUnderlayNetworkForNodeName

func FindUnderlayNetworkForNodeName(ctx context.Context, client client.Reader, nodeName string) (underlayNetworkName string, err error)

func GetClusterUUID

func GetClusterUUID(ctx context.Context, c client.Reader) (types.UID, error)

func GetIndexFromName

func GetIndexFromName(name string) int

func GetNetwork

func GetNetwork(ctx context.Context, client client.Reader, name string) (*networkingv1.Network, error)

func GetPod added in v0.5.0

func GetPod(ctx context.Context, client client.Reader, name, namespace string) (*corev1.Pod, error)

func GetRemoteCluster

func GetRemoteCluster(ctx context.Context, client client.Reader, name string) (*multiclusterv1.RemoteCluster, error)

func GetSubnet

func GetSubnet(ctx context.Context, client client.Reader, name string) (*networkingv1.Subnet, error)

func ListActiveNodesToNames added in v0.7.0

func ListActiveNodesToNames(ctx context.Context, client client.Reader, opts ...client.ListOption) ([]string, error)

func ListActiveSubnetsToNames added in v0.7.0

func ListActiveSubnetsToNames(ctx context.Context, client client.Reader, opts ...client.ListOption) ([]string, error)

func ListAllocatedIPInstances added in v0.6.0

func ListAllocatedIPInstances(ctx context.Context, c client.Reader, opts ...client.ListOption) (ips []*networkingv1.IPInstance, err error)

ListAllocatedIPInstances will list allocated (non-terminating) IPInstances by some specified filters

func ListAllocatedIPInstancesOfPod

func ListAllocatedIPInstancesOfPod(ctx context.Context, c client.Reader, pod *corev1.Pod) (ips []*networkingv1.IPInstance, err error)

func ListIPInstances

func ListIPInstances(ctx context.Context, client client.Reader, opts ...client.ListOption) (*networkingv1.IPInstanceList, error)

func ListNetworks

func ListNetworks(ctx context.Context, client client.Reader, opts ...client.ListOption) (*networkingv1.NetworkList, error)

func ListRemoteClusters

func ListRemoteClusters(ctx context.Context, client client.Reader, opts ...client.ListOption) (*multiclusterv1.RemoteClusterList, error)

func ListRemoteSubnets

func ListRemoteSubnets(ctx context.Context, client client.Reader, opts ...client.ListOption) (*multiclusterv1.RemoteSubnetList, error)

func ListRemoteVteps

func ListRemoteVteps(ctx context.Context, client client.Reader, opts ...client.ListOption) (*multiclusterv1.RemoteVtepList, error)

func ListSubnets

func ListSubnets(ctx context.Context, client client.Reader, opts ...client.ListOption) (*networkingv1.SubnetList, error)

func NetworkTypePredicate added in v0.7.0

func NetworkTypePredicate(networkType networkingv1.NetworkType) predicate.Predicate

func NewRestConfigFromRemoteCluster

func NewRestConfigFromRemoteCluster(remoteCluster *multiclusterv1.RemoteCluster) (*rest.Config, error)

func PodIsCompleted

func PodIsCompleted(pod *v1.Pod) bool

func PodIsEvicted

func PodIsEvicted(pod *v1.Pod) bool

func PodIsScheduled added in v0.7.7

func PodIsScheduled(pod *v1.Pod) bool

func ToIPFormat

func ToIPFormat(name string) string

Types

type IPInstancePhaseChangePredicate

type IPInstancePhaseChangePredicate struct {
	predicate.Funcs
}

func (IPInstancePhaseChangePredicate) Update

Update implements default UpdateEvent filter for checking whether IPInstance phase change

type IgnoreDeletePredicate

type IgnoreDeletePredicate struct {
	predicate.Funcs
}

IgnoreDeletePredicate will ignore the delete event, if finalizer is used, this predicate will help to reduce reconciliation count

func (IgnoreDeletePredicate) Delete

type IgnoreUpdatePredicate

type IgnoreUpdatePredicate struct {
	predicate.Funcs
}

IgnoreUpdatePredicate will ignore the update event

func (IgnoreUpdatePredicate) Update

type NetworkOfNodeChangePredicate

type NetworkOfNodeChangePredicate struct {
	Context context.Context
	Client  client.Client
	predicate.Funcs
}

func (NetworkOfNodeChangePredicate) Update

type NetworkSpecChangePredicate

type NetworkSpecChangePredicate struct {
	predicate.Funcs
}

func (NetworkSpecChangePredicate) Update

type NetworkStatusChangePredicate

type NetworkStatusChangePredicate struct {
	predicate.Funcs
}

func (NetworkStatusChangePredicate) Update

type RemoteClusterUUIDChangePredicate

type RemoteClusterUUIDChangePredicate struct {
	predicate.Funcs
}

func (RemoteClusterUUIDChangePredicate) Update

type SpecifiedAnnotationChangedPredicate

type SpecifiedAnnotationChangedPredicate struct {
	predicate.Funcs
	AnnotationKeys []string
}

func (SpecifiedAnnotationChangedPredicate) Update

Update implements default UpdateEvent filter for validating specified annotations change

type SpecifiedLabelChangedPredicate

type SpecifiedLabelChangedPredicate struct {
	predicate.Funcs
	LabelKeys []string
}

func (SpecifiedLabelChangedPredicate) Update

Update implements default UpdateEvent filter for validating specified annotations change

type SubnetSpecChangePredicate

type SubnetSpecChangePredicate struct {
	predicate.Funcs
}

func (SubnetSpecChangePredicate) Update

type TerminatingPredicate

type TerminatingPredicate struct {
	predicate.Funcs
}

func (TerminatingPredicate) Create

func (TerminatingPredicate) Update

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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