util

package
v0.29.8 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindOriginCosts

func FindOriginCosts(originList []ntv1alpha1.OriginInfo, origin string) []ntv1alpha1.CostInfo

FindOriginCosts : return the costList for a certain origin

func FindPodOrder

func FindPodOrder(t agv1alpha1.AppGroupTopologyList, selector string) int32

FindPodOrder : return the order index of the given pod

func FindTopologyKey

func FindTopologyKey(topologyList []ntv1alpha1.TopologyInfo, key ntv1alpha1.TopologyKey) ntv1alpha1.OriginList

FindTopologyKey : return the originList for a certain key

func GetDependencyList

func GetDependencyList(pod *v1.Pod, ag *agv1alpha1.AppGroup) []agv1alpha1.DependenciesInfo

GetDependencyList : get workload dependencies established in the AppGroup CR

func GetNodeRegion

func GetNodeRegion(node *v1.Node) string

GetNodeRegion : return the region of the node

func GetNodeZone

func GetNodeZone(node *v1.Node) string

GetNodeZone : return the zone of the node

func GetPodAppGroupLabel

func GetPodAppGroupLabel(pod *v1.Pod) string

GetPodAppGroupLabel : get AppGroup from pod annotations

func GetPodAppGroupSelector

func GetPodAppGroupSelector(pod *v1.Pod) string

GetPodAppGroupSelector : get Workload Selector from pod annotations

Types

type ByDestination

type ByDestination ntv1alpha1.CostList

ByDestination : Sort CostList by Destination (e.g., Region Name, Zone Name)

func (ByDestination) Len

func (s ByDestination) Len() int

func (ByDestination) Less

func (s ByDestination) Less(i, j int) bool

func (ByDestination) Swap

func (s ByDestination) Swap(i, j int)

type ByOrigin

type ByOrigin ntv1alpha1.OriginList

ByOrigin : Sort OriginList by Origin (e.g., Region Name, Zone Name)

func (ByOrigin) Len

func (s ByOrigin) Len() int

func (ByOrigin) Less

func (s ByOrigin) Less(i, j int) bool

func (ByOrigin) Swap

func (s ByOrigin) Swap(i, j int)

type ByTopologyKey

type ByTopologyKey ntv1alpha1.TopologyList

ByTopologyKey : Sort TopologyList by TopologyKey

func (ByTopologyKey) Len

func (s ByTopologyKey) Len() int

func (ByTopologyKey) Less

func (s ByTopologyKey) Less(i, j int) bool

func (ByTopologyKey) Swap

func (s ByTopologyKey) Swap(i, j int)

type ByWorkloadSelector

type ByWorkloadSelector agv1alpha1.AppGroupTopologyList

ByWorkloadSelector : Sort AppGroupTopologyList by Workload.Selector

func (ByWorkloadSelector) Len

func (s ByWorkloadSelector) Len() int

func (ByWorkloadSelector) Less

func (s ByWorkloadSelector) Less(i, j int) bool

func (ByWorkloadSelector) Swap

func (s ByWorkloadSelector) Swap(i, j int)

type CostKey

type CostKey struct {
	Origin      string
	Destination string
}

CostKey : key for map concerning network costs (origin / destinations)

type ScheduledInfo

type ScheduledInfo struct {
	// Pod Name
	Name string

	// Pod AppGroup Selector
	Selector string

	// Replica ID
	ReplicaID string

	// Hostname
	Hostname string
}

ScheduledInfo : struct for scheduled pods

type ScheduledList

type ScheduledList []ScheduledInfo

func GetScheduledList

func GetScheduledList(pods []*v1.Pod) ScheduledList

GetScheduledList : get Pods already scheduled in the cluster for that specific AppGroup

Jump to

Keyboard shortcuts

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