kubernetes

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 6, 2022 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AnnotationPrefix = "cnfuzz"
	IgnoreMeAnno     = "ignore"
	FuzzMeAnno       = "enable"
	OpenApiDocAnno   = "open-api-doc"
	SecretAnno       = "secret"
	UsernameAnno     = "username"
)

Variables

This section is empty.

Functions

func CreateClientSet

func CreateClientSet(insideCluster bool) (clientset kubernetes.Interface, err error)

CreateClientSet create a client to interact with the Kubernetes API

func FuzzPod

func FuzzPod(pod *v1.Pod) error

FuzzPod fuzz a pod from a Pod object

func FuzzPodWithClientset

func FuzzPodWithClientset(clientSet kubernetes.Interface, pod *v1.Pod) error

FuzzPodWithClientset start the fuzzing process for a pod

func FuzzPodWithName

func FuzzPodWithName(namespace string, podName string) (err error)

FuzzPodWithName fuzz a pod from just its name and namespace

func HandlePodEvent

func HandlePodEvent(clientSet kubernetes.Interface, repositories *repository.Repositories, pod *apiv1.Pod)

HandlePodEvent method that handles an event for a pod it decides if the pod needs to be fuzzed and can start the fuzzing process when the pod is ready

func StartInformers

func StartInformers(repos *repository.Repositories) (err error)

StartInformers start informers that listen for Kubernetes events and let the EventHandler react on the events

Types

type Annotations

type Annotations struct {
	IgnoreMe           bool
	FuzzMe             bool
	OpenApiDocLocation string
	Secret             string
	Username           string
}

Annotations annotation values for annotations to be used inside Kubernetes configurations

func GetAnnotations

func GetAnnotations(objectMeta *metav1.ObjectMeta) Annotations

GetAnnotations gather annotations inside the metadata of a Kubernetes object

func (Annotations) SetConfigRegister

func (annos Annotations) SetConfigRegister()

SetConfigRegister looks in the annotations object for empty values and tries to fill them with values from the config register

type EventHandler

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

EventHandler that handles Kubernetes events if it detects a pod with an image that hasn't been fuzzed yet, it will try to fuzz the pod

func NewEventHandler

func NewEventHandler(clientset kubernetes.Interface, repositories *repository.Repositories) *EventHandler

NewEventHandler creates a new EventHandler

func (EventHandler) OnAdd

func (handler EventHandler) OnAdd(obj any)

OnAdd handles an add event

func (EventHandler) OnDelete

func (handler EventHandler) OnDelete(obj any)

OnDelete handles a delete event

func (EventHandler) OnUpdate

func (handler EventHandler) OnUpdate(oldObj any, newObj any)

OnUpdate handles an update event

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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