Documentation ¶
Index ¶
- Constants
- Variables
- func FilterLabels(labels map[string]string) map[string]string
- func GenerateNetworkNeighborsCRD(parentWorkload k8sinterface.IWorkload, ...) *v1beta1.NetworkNeighbors
- func GenerateNetworkNeighborsNameFromWlid(parentWlid string) string
- func GeneratePortIdentifier(protocol string, port int32) string
- func GeneratePortIdentifierFromEvent(networkEvent NetworkEvent) string
- type Destination
- type EndpointKind
- type NetworkEvent
- type NetworkManagerClient
- type NetworkManagerMock
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 ¶
FilterLabels filters out labels that are not relevant for the network neighbor
func GenerateNetworkNeighborsCRD ¶
func GenerateNetworkNeighborsCRD(parentWorkload k8sinterface.IWorkload, parentWorkloadSelector *metav1.LabelSelector, clusterName string) *v1beta1.NetworkNeighbors
func GeneratePortIdentifier ¶
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)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.