networkmanager

package
v0.2.320 Latest Latest
Warning

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

Go to latest
Published: May 11, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InternalTrafficType = "internal"
	ExternalTrafficType = "external"
	HostPktType         = "HOST"
	OutgoingPktType     = "OUTGOING"
)

Variables

View Source
var DefaultLabelsToIgnore = map[string]struct{}{
	"controller-revision-hash": {},
	"pod-template-generation":  {},
	"pod-template-hash":        {},
}

Functions

func FilterLabels

func FilterLabels(labels map[string]string) map[string]string

FilterLabels filters out labels that are not relevant for the network neighbor

func GeneratePortIdentifier

func GeneratePortIdentifier(protocol string, port int32) string

func GeneratePortIdentifierFromEvent

func GeneratePortIdentifierFromEvent(networkEvent NetworkEvent) string

Types

type Destination

type Destination struct {
	Namespace string
	Name      string
	Kind      EndpointKind
	PodLabels string
	IPAddress string
}

type EndpointKind

type EndpointKind string
const (
	EndpointKindPod     EndpointKind = "pod"
	EndpointKindService EndpointKind = "svc"
	EndpointKindRaw     EndpointKind = "raw"
)

type NetworkEvent

type NetworkEvent struct {
	Port        uint16
	PktType     string
	Protocol    string
	PodLabels   string
	Destination Destination
}

func (*NetworkEvent) GetDestinationPodLabels

func (ne *NetworkEvent) GetDestinationPodLabels() map[string]string

GetDestinationPodLabels returns a map of pod labels from the string in the network event. The labels are saved separated by commas, so we need to split them

func (*NetworkEvent) SetDestinationPodLabels

func (ne *NetworkEvent) SetDestinationPodLabels(podLabels map[string]string)

func (*NetworkEvent) SetPodLabels

func (ne *NetworkEvent) SetPodLabels(podLabels map[string]string)

func (*NetworkEvent) String

func (ne *NetworkEvent) String() string

type NetworkManagerClient

type NetworkManagerClient interface {
	ContainerCallback(notif containercollection.PubSubEvent)
	ContainerReachedMaxTime(containerID string)
	ReportNetworkEvent(k8sContainerID string, event tracernetworktype.Event)
	ReportDroppedEvent(k8sContainerID string)
}

type NetworkManagerMock

type NetworkManagerMock struct {
}

func CreateNetworkManagerMock

func CreateNetworkManagerMock() *NetworkManagerMock

func (*NetworkManagerMock) ContainerCallback

func (am *NetworkManagerMock) ContainerCallback(_ containercollection.PubSubEvent)

func (*NetworkManagerMock) ContainerReachedMaxTime

func (am *NetworkManagerMock) ContainerReachedMaxTime(_ string)

func (*NetworkManagerMock) ReportDroppedEvent

func (am *NetworkManagerMock) ReportDroppedEvent(_ string)

func (*NetworkManagerMock) ReportNetworkEvent

func (am *NetworkManagerMock) ReportNetworkEvent(_ string, _ tracernetworktype.Event)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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