utils

package
v0.5.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ToDNSFormat = utils.ToDNSFormat
)

Functions

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 GetIPOfPod

func GetIPOfPod(ctx context.Context, c client.Reader, pod *corev1.Pod) (string, 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 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 ListIPsOfPod

func ListIPsOfPod(ctx context.Context, c client.Reader, pod *corev1.Pod) ([]string, error)

func ListNetworks

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

func ListNodesToNames

func ListNodesToNames(ctx context.Context, client client.Reader, opts ...client.ListOption) ([]string, 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 ListSubnetsToNames

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

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 ToIPFamilyMode

func ToIPFamilyMode(isIPv6 bool) types.IPFamilyMode

func ToIPFormat

func ToIPFormat(name string) string

func ToIPFormatWithFamily

func ToIPFormatWithFamily(name string) (string, bool)

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