k8score

package
v0.9.2-beta.17 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2024 License: AGPL-3.0 Imports: 14 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EventHandlerMap = map[string]EventHandler{}

Functions

func IsOvertimeEvent

func IsOvertimeEvent(event *corev1.Event, timeout time.Duration) bool

IsOvertimeEvent checks whether the duration of warning event reaches the threshold.

Types

type EventHandler

type EventHandler interface {
	Handle(client.Client, intctrlutil.RequestCtx, record.EventRecorder, *corev1.Event) error
}

type EventReconciler

type EventReconciler struct {
	client.Client
	Scheme   *runtime.Scheme
	Recorder record.EventRecorder
}

EventReconciler reconciles an Event object

func (*EventReconciler) Reconcile

func (r *EventReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.14.4/pkg/reconcile

func (*EventReconciler) SetupWithManager

func (r *EventReconciler) SetupWithManager(mgr ctrl.Manager, multiClusterMgr multicluster.Manager) error

SetupWithManager sets up the controller with the Manager.

type ProbeEventType

type ProbeEventType string

ProbeEventType defines the type of probe event.

type ProbeMessage

type ProbeMessage struct {
	Event        ProbeEventType    `json:"event,omitempty"`
	Message      string            `json:"message,omitempty"`
	OriginalRole string            `json:"originalRole,omitempty"`
	Role         string            `json:"role,omitempty"`
	Term         int               `json:"term,omitempty"`
	PodName2Role map[string]string `json:"map,omitempty"`
}

func ParseProbeEventMessage

func ParseProbeEventMessage(reqCtx intctrlutil.RequestCtx, event *corev1.Event) *ProbeMessage

ParseProbeEventMessage parses probe event message.

Jump to

Keyboard shortcuts

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