resourceinfo

package
v0.0.0-...-9f7285a Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

type Cluster struct {
	EndpointSlices *EndpointSliceInfo
	IPs            *resourcelease.ResourceLeaseHistory[*resourcelease.K8sResourceLeaseHolder]
	// records lease history of NEG id to ServiceNetworkEndpointGroup
	NEGs          *resourcelease.ResourceLeaseHistory[*resourcelease.K8sResourceLeaseHolder]
	PodSandboxIDs *resourcelease.ResourceLeaseHistory[*resourcelease.K8sResourceLeaseHolder]
	ContainerIDs  *resourcelease.ResourceLeaseHistory[*resourcelease.ContainerLeaseHolder]
	// CRIResource       *CRIResourceBinder
	ContainerStatuses *ContainerStatuses
	// contains filtered or unexported fields
}

Cluster stores resource information(node name, Pod IP,Host IP...etc) used from another parser. This struct must modify the own fields in thread safe.

func NewClusterResourceInfo

func NewClusterResourceInfo() *Cluster

func (*Cluster) AddNode

func (c *Cluster) AddNode(nodeName string)

AddNode registeres the node name

func (*Cluster) GetNodeResourceIDTypeFromID

func (c *Cluster) GetNodeResourceIDTypeFromID(id string, t time.Time) NodeResourceIDType

GetNodeResourceIDTypeFromID tries to find if the given id is for a pod sandbox or container at the given time.

func (*Cluster) GetNodes

func (c *Cluster) GetNodes() []string

GetNodes returns copy of the list of node names

type ContainerStatuses

type ContainerStatuses struct {
	// contains filtered or unexported fields
}

func (*ContainerStatuses) IsNewChange

func (c *ContainerStatuses) IsNewChange(namespace string, podname string, containerName string, status corev1.ContainerStatus) bool

type EndpointSliceEndpointDiff

type EndpointSliceEndpointDiff struct {
	Operation EndppointSliceEndpointDiffOperation
	Current   *model.EndpointSliceEndpoint
	Previous  *model.EndpointSliceEndpoint
	TargetRef *model.K8sTargetRef
}

type EndpointSliceInfo

type EndpointSliceInfo struct {
	// contains filtered or unexported fields
}

func (*EndpointSliceInfo) GetLastDiffs

func (e *EndpointSliceInfo) GetLastDiffs(uid string) ([]*EndpointSliceEndpointDiff, error)

func (*EndpointSliceInfo) ReadEndpointSlice

func (e *EndpointSliceInfo) ReadEndpointSlice(reader *structure.Reader, time time.Time) (string, error)

ReadEndpointSlice parse given EndpointSlice manifest and returns the uid of endpoint slice

type EndppointSliceEndpointDiffOperation

type EndppointSliceEndpointDiffOperation = string
const (
	DiffNew     EndppointSliceEndpointDiffOperation = "NEW"
	DiffChanged EndppointSliceEndpointDiffOperation = "CHANGED"
	DiffDeleted EndppointSliceEndpointDiffOperation = "DELETED"
)

type NodeResourceIDType

type NodeResourceIDType int

NodeResourceIDType is enums to represent the type of ids.

const (
	NodeResourceIDTypeUnknown    NodeResourceIDType = 0
	NodeResourceIDTypeContainer  NodeResourceIDType = 1
	NodeResourceIDTypePodSandbox NodeResourceIDType = 2
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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