standard_k8s

package
v1.9.1 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2024 License: Apache-2.0 Imports: 19 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StandardK8sTrigger

type StandardK8sTrigger struct {
	// K8sClient is kubernetes client
	K8sClient kubernetes.Interface
	// Dynamic client is Kubernetes dymalic client
	DynamicClient dynamic.Interface
	// Sensor object
	Sensor *v1alpha1.Sensor
	// Trigger definition
	Trigger *v1alpha1.Trigger
	// logger to log stuff
	Logger *zap.SugaredLogger
	// contains filtered or unexported fields
}

StandardK8STrigger implements Trigger interface for standard Kubernetes resources

func NewStandardK8sTrigger

func NewStandardK8sTrigger(k8sClient kubernetes.Interface, dynamicClient dynamic.Interface, sensor *v1alpha1.Sensor, trigger *v1alpha1.Trigger, logger *zap.SugaredLogger) *StandardK8sTrigger

NewStandardK8sTrigger returns a new StandardK8STrigger

func (*StandardK8sTrigger) ApplyPolicy

func (k8sTrigger *StandardK8sTrigger) ApplyPolicy(ctx context.Context, resource interface{}) error

ApplyPolicy applies the policy on the trigger

func (*StandardK8sTrigger) ApplyResourceParameters

func (k8sTrigger *StandardK8sTrigger) ApplyResourceParameters(events map[string]*v1alpha1.Event, resource interface{}) (interface{}, error)

ApplyResourceParameters applies parameters to the trigger resource

func (*StandardK8sTrigger) Execute

func (k8sTrigger *StandardK8sTrigger) Execute(ctx context.Context, events map[string]*v1alpha1.Event, resource interface{}) (interface{}, error)

Execute executes the trigger

func (*StandardK8sTrigger) FetchResource

func (k8sTrigger *StandardK8sTrigger) FetchResource(ctx context.Context) (interface{}, error)

FetchResource fetches the trigger resource from external source

func (*StandardK8sTrigger) GetTriggerType added in v1.3.0

func (k8sTrigger *StandardK8sTrigger) GetTriggerType() apicommon.TriggerType

GetTriggerType returns the type of the trigger

Jump to

Keyboard shortcuts

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