event

package
v0.0.0-...-ecf1725 Latest Latest
Warning

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

Go to latest
Published: May 31, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EmptyEventList = &common.EventList{
	Events: make([]common.Event, 0),
	ListMeta: api.ListMeta{
		TotalItems: 0,
	},
}

EmptyEventList is a empty list of events.

View Source
var FailedReasonPartials = []string{"failed", "err", "exceeded", "invalid", "unhealthy",
	"mismatch", "insufficient", "conflict", "outof", "nil", "backoff"}

FailedReasonPartials is an array of partial strings to correctly filter warning events. Have to be lower case for correct case insensitive comparison. Based on k8s official events reason file: https://github.com/kubernetes/kubernetes/blob/886e04f1fffbb04faf8a9f9ee141143b2684ae68/pkg/kubelet/events/event.go Partial strings that are not in event.go file are added in order to support older versions of k8s which contained additional event reason messages.

Functions

func CreateEventList

func CreateEventList(events []v1.Event, dsQuery *dataselect.DataSelectQuery) common.EventList

CreateEventList converts array of api events to common EventList structure

func FillEventsType

func FillEventsType(events []v1.Event) []v1.Event

FillEventsType is based on event Reason fills event Type in order to allow correct filtering by Type.

func GetEventList

func GetEventList(client k8sClient.Interface, nsQuery *common.NamespaceQuery,
	dsQuery *dataselect.DataSelectQuery) (*common.EventList, error)

func GetEventListFromChannels

func GetEventListFromChannels(channels *common.ResourceChannels, dsQuery *dataselect.DataSelectQuery) (*common.EventList, error)

func GetEvents

func GetEvents(client kubernetes.Interface, namespace, resourceName string) ([]v1.Event, error)

GetEvents gets events associated to resource with given name.

func GetNamespaceEvents

func GetNamespaceEvents(client kubernetes.Interface, dsQuery *dataselect.DataSelectQuery, namespace string) (common.EventList, error)

GetNamespaceEvents gets events associated to a namespace with given name.

func GetNodeEvents

func GetNodeEvents(client kubernetes.Interface, dsQuery *dataselect.DataSelectQuery, nodeName string) (*common.EventList, error)

GetNodeEvents gets events associated to node with given name.

func GetPodEvents

func GetPodEvents(client kubernetes.Interface, namespace, podName string) ([]v1.Event, error)

GetPodEvents gets pods events associated to pod name and namespace

func GetPodsEventWarnings

func GetPodsEventWarnings(events []api.Event, pods []api.Pod) []common.Event

GetPodsEventWarnings returns warning pod events by filtering out events targeting only given pods

func GetPodsEvents

func GetPodsEvents(client kubernetes.Interface, namespace string, pods []v1.Pod) (
	[]v1.Event, error)

GetPodsEvents gets events targeting given list of pods.

func GetResourceEvents

func GetResourceEvents(client kubernetes.Interface, dsQuery *dataselect.DataSelectQuery, namespace, name string) (
	*common.EventList, error)

GetResourceEvents gets events associated to specified resource.

func ToEvent

func ToEvent(event v1.Event) common.Event

ToEvent converts event api Event to Event model object.

Types

type EventCell

type EventCell v1.Event

func (EventCell) GetProperty

Jump to

Keyboard shortcuts

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