v1

package
v1.13.7 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package v1 contains API Schema definitions for the eventlogger v1 API group +kubebuilder:object:generate=true +groupName=eventlogger.bakito.ch

Index

Constants

This section is empty.

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "eventlogger.bakito.ch", Version: "v1"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)

Functions

This section is empty.

Types

type EventLogger

type EventLogger struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   EventLoggerSpec   `json:"spec,omitempty"`
	Status EventLoggerStatus `json:"status,omitempty"`
}

EventLogger is the Schema for the eventloggers API

func (*EventLogger) Apply

func (in *EventLogger) Apply(err error)

Apply update the status of the current event logger

func (*EventLogger) DeepCopy

func (in *EventLogger) DeepCopy() *EventLogger

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EventLogger.

func (*EventLogger) DeepCopyInto

func (in *EventLogger) DeepCopyInto(out *EventLogger)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*EventLogger) DeepCopyObject

func (in *EventLogger) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*EventLogger) HasChanged added in v0.6.0

func (in *EventLogger) HasChanged() bool

HasChanged check if the spec or operator version has changed

func (*EventLogger) SetupWebhookWithManager

func (in *EventLogger) SetupWebhookWithManager(mgr ctrl.Manager) error

SetupWebhookWithManager setup with manager

func (*EventLogger) ValidateCreate

func (in *EventLogger) ValidateCreate() (admission.Warnings, error)

ValidateCreate implements webhook.Validator so a webhook will be registered for the type

func (*EventLogger) ValidateDelete

func (in *EventLogger) ValidateDelete() (admission.Warnings, error)

ValidateDelete implements webhook.Validator so a webhook will be registered for the type

func (*EventLogger) ValidateUpdate

func (in *EventLogger) ValidateUpdate(_ runtime.Object) (admission.Warnings, error)

ValidateUpdate implements webhook.Validator so a webhook will be registered for the type

type EventLoggerList

type EventLoggerList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []EventLogger `json:"items"`
}

EventLoggerList contains a list of EventLogger

func (*EventLoggerList) DeepCopy

func (in *EventLoggerList) DeepCopy() *EventLoggerList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EventLoggerList.

func (*EventLoggerList) DeepCopyInto

func (in *EventLoggerList) DeepCopyInto(out *EventLoggerList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*EventLoggerList) DeepCopyObject

func (in *EventLoggerList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type EventLoggerSpec

type EventLoggerSpec struct {
	// Kinds the kinds to log the events for
	// +kubebuilder:validation:MinItems=1
	Kinds []Kind `json:"kinds,omitempty"`

	// EventTypes the event types to log. If empty all events are logged.
	// +kubebuilder:validation:MinItems=0
	EventTypes []string `json:"eventTypes,omitempty"`

	// Labels additional labels for the logger pod
	Labels map[string]string `json:"labels,omitempty" validate:"k8s-label-annotation-keys,k8s-label-values"`

	// Labels additional annotations for the logger pod
	Annotations map[string]string `json:"annotations,omitempty" validate:"k8s-label-annotation-keys"`

	// ScrapeMetrics if true, prometheus scrape annotations are added to the pod
	ScrapeMetrics *bool `json:"scrapeMetrics,omitempty"`

	// namespace the namespace to watch on, may be an empty string
	// +nullable
	// +optional
	Namespace *string `json:"namespace,omitempty"`

	// ServiceAccount the service account to use for the logger pod
	ServiceAccount string `json:"serviceAccount,omitempty"`

	// NodeSelector is a selector which must be true for the pod to fit on a node.
	// Selector which must match a node's labels for the pod to be scheduled on that node.
	// More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/
	// +optional
	NodeSelector map[string]string `json:"nodeSelector,omitempty" validate:"k8s-label-annotation-keys,k8s-label-values"`

	// LogFields fields ot the event to be logged.
	LogFields []LogField `json:"logFields,omitempty"`
}

EventLoggerSpec defines the desired state of EventLogger

func (*EventLoggerSpec) DeepCopy

func (in *EventLoggerSpec) DeepCopy() *EventLoggerSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EventLoggerSpec.

func (*EventLoggerSpec) DeepCopyInto

func (in *EventLoggerSpec) DeepCopyInto(out *EventLoggerSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*EventLoggerSpec) Hash added in v0.5.5

func (in *EventLoggerSpec) Hash() string

Hash the event

func (*EventLoggerSpec) Validate added in v0.5.5

func (in *EventLoggerSpec) Validate() error

Validate the event

type EventLoggerStatus

type EventLoggerStatus struct {
	// OperatorVersion the version of the operator that processed the cr
	OperatorVersion string `json:"operatorVersion"`
	// LastProcessed the timestamp the cr was last processed
	LastProcessed metav1.Time `json:"lastProcessed"`
	// Hash
	Hash string `json:"hash,omitempty"`
	// Error
	Error string `json:"error,omitempty"`
}

EventLoggerStatus defines the observed state of EventLogger

func (*EventLoggerStatus) DeepCopy

func (in *EventLoggerStatus) DeepCopy() *EventLoggerStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EventLoggerStatus.

func (*EventLoggerStatus) DeepCopyInto

func (in *EventLoggerStatus) DeepCopyInto(out *EventLoggerStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Kind

type Kind struct {
	// +kubebuilder:validation:MinLength=3
	Name string `json:"name"`

	// +optional
	// +nullable
	APIGroup *string `json:"apiGroup,omitempty"`

	// EventTypes the event types to log. If empty events are logged as defined in spec.
	// +kubebuilder:validation:MinItems=0
	EventTypes []string `json:"eventTypes,omitempty"`

	// Reasons the event reasons to log. If empty events with any reasons are logged.
	// +kubebuilder:validation:MinItems=0
	Reasons []string `json:"reasons,omitempty"`

	// SkipReasons event reasons to log to skip. If empty events with any reasons are logged.
	// +kubebuilder:validation:MinItems=0
	SkipReasons []string `json:"skipReasons,omitempty"`

	// MatchingPatterns optional regex pattern that must be contained in the message to be logged
	// +kubebuilder:validation:MinItems=0
	MatchingPatterns []string `json:"matchingPatterns,omitempty"`

	// SkipOnMatch skip the entry if matched
	SkipOnMatch *bool `json:"skipOnMatch,omitempty"`
}

Kind defines a kind to log events for

func (*Kind) DeepCopy

func (in *Kind) DeepCopy() *Kind

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Kind.

func (*Kind) DeepCopyInto

func (in *Kind) DeepCopyInto(out *Kind)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type LogField

type LogField struct {
	// name of the log field
	Name string `json:"name"`
	// Path within the corev1.Event struct https://github.com/kubernetes/api/blob/master/core/v1/types.go
	// +kubebuilder:validation:MinItems=1
	Path []string `json:"path,omitempty"`

	// Value a static value of the log field. Can be uses to add static log fields
	// +optional
	// +nullable
	Value *string `json:"value,omitempty"`
}

LogField defines a log field

func (*LogField) DeepCopy

func (in *LogField) DeepCopy() *LogField

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LogField.

func (*LogField) DeepCopyInto

func (in *LogField) DeepCopyInto(out *LogField)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Jump to

Keyboard shortcuts

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