helpers

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetClientOrDie

func GetClientOrDie() *bpfmanclientset.Clientset

GetClientOrDie gets the bpfman Kubernetes Client dynamically switching between in cluster and out of cluster config setup.

func IsBpfProgramConditionFailure

func IsBpfProgramConditionFailure(conditions *[]metav1.Condition) bool

func IsBpfmanDeployed

func IsBpfmanDeployed() bool

IsBpfmanDeployed is used to check for the existence of bpfman in a Kubernetes cluster. Specifically it checks for the existence of the bpfman.io CRD api group within the apiserver. If getting the k8s config fails this will panic.

func WaitForBpfProgConfLoad

func WaitForBpfProgConfLoad(c *bpfmanclientset.Clientset, progName string, timeout time.Duration, progType ProgramType) error

WaitForBpfProgConfLoad ensures the Program object is loaded and deployed successfully, specifically it checks the config objects' conditions to look for the `Loaded` state.

Types

type ProgramType

type ProgramType int32

Must match the internal bpfman-api mappings

const (
	Kprobe     ProgramType = 2
	Tc         ProgramType = 3
	Tracepoint ProgramType = 5
	Xdp        ProgramType = 6
	Tracing    ProgramType = 26
)

func FromString

func FromString(p string) (*ProgramType, error)

func (ProgramType) String

func (p ProgramType) String() string

func (ProgramType) Uint32

func (p ProgramType) Uint32() *uint32

type TcProgramDirection

type TcProgramDirection int32
const (
	Ingress TcProgramDirection = 1
	Egress  TcProgramDirection = 2
)

func (TcProgramDirection) String

func (t TcProgramDirection) String() string

Jump to

Keyboard shortcuts

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