capture

package
v0.0.1-pre Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: MIT Imports: 30 Imported by: 0

Documentation

Overview

Package capture contains functions related to handling Retina/Capture.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CaptureJobNumExceedLimitError

type CaptureJobNumExceedLimitError struct {
	CurrentNum int
	Limit      int
}

func (CaptureJobNumExceedLimitError) Error

type CaptureManager

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

CaptureManager captures network packets and metadata into tar ball, then send the tar ball to the location(s) specified by users.

func NewCaptureManager

func NewCaptureManager(logger *log.ZapLogger, tel telemetry.Telemetry) *CaptureManager

func (*CaptureManager) CaptureNetwork

func (cm *CaptureManager) CaptureNetwork(sigChan <-chan os.Signal) (string, error)

func (*CaptureManager) Cleanup

func (cm *CaptureManager) Cleanup() error

func (*CaptureManager) OutputCapture

func (cm *CaptureManager) OutputCapture(srcDir string) error

type CaptureTarget

type CaptureTarget struct {
	// PodIpAddresses indicates the capture is performed on the Pods per their IP addresses.
	PodIpAddresses []string
	// CaptureNodeInterface indicates the capture is performed on the host node interface.
	CaptureNodeInterface bool

	// OS indicates the operating system of the node hosting the target.
	OS string
}

CaptureTarget indicates on which the network capture will be performed on a given node.

type CaptureTargetsOnNode

type CaptureTargetsOnNode map[string]CaptureTarget

CaptureTargetsOnNode maps nodes to the targets network capture will be performed. On each node, the network capture can be done on either Pod hosted in the node, or the node interface itself. When multiple nodes are selected per capture configuration, there'll be multiple jobs created per node.

func (CaptureTargetsOnNode) AddNodeInterface

func (cton CaptureTargetsOnNode) AddNodeInterface(hostname string)

func (CaptureTargetsOnNode) AddPod

func (cton CaptureTargetsOnNode) AddPod(hostname string, ipAddresses []string)

func (CaptureTargetsOnNode) UpdateNodeOS

func (cton CaptureTargetsOnNode) UpdateNodeOS(hostname string, os string)

type CaptureToPodTranslator

type CaptureToPodTranslator struct {

	// Apiserver is unique identifier to identify the cluster in the trace capture.
	Apiserver string
	// contains filtered or unexported fields
}

CaptureToPodTranslator translate the Capture object to a Job.

func NewCaptureToPodTranslator

func NewCaptureToPodTranslator(kubeClient kubernetes.Interface, logger *log.ZapLogger, config config.CaptureConfig) *CaptureToPodTranslator

NewCaptureToPodTranslator initializes a CaptureToPodTranslator.

func (*CaptureToPodTranslator) CalculateCaptureTargetsOnNode

func (translator *CaptureToPodTranslator) CalculateCaptureTargetsOnNode(captureTarget retinav1alpha1.CaptureTarget) (*CaptureTargetsOnNode, error)

CalculateCaptureTargetsOnNode returns capture target on each node.

func (*CaptureToPodTranslator) ObtainCaptureJobPodEnv

func (translator *CaptureToPodTranslator) ObtainCaptureJobPodEnv(capture retinav1alpha1.Capture) (map[string]string, error)

ObtainCaptureJobPodEnv translates Capture object to Environment variables to capture job Pod.

func (*CaptureToPodTranslator) TranslateCaptureToJobs

func (translator *CaptureToPodTranslator) TranslateCaptureToJobs(capture *retinav1alpha1.Capture) ([]*batchv1.Job, error)

type SecretNotFoundError

type SecretNotFoundError struct {
	SecretName string
	Namespace  string
}

func (SecretNotFoundError) Error

func (err SecretNotFoundError) Error() string

Directories

Path Synopsis
Package provider is a generated GoMock package.
Package provider is a generated GoMock package.

Jump to

Keyboard shortcuts

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