k8score

package
v0.6.0-beta.42 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2023 License: AGPL-3.0 Imports: 20 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

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

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) error

SetupWithManager sets up the controller with the Manager.

type HandlePersistentVolumeClaim

type HandlePersistentVolumeClaim func(reqCtx intctrlutil.RequestCtx, cli client.Client, pvc *corev1.PersistentVolumeClaim) error

type PersistentVolumeClaimReconciler

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

PersistentVolumeClaimReconciler reconciles a PersistentVolumeClaim object

func (*PersistentVolumeClaimReconciler) Reconcile

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 (*PersistentVolumeClaimReconciler) SetupWithManager

func (r *PersistentVolumeClaimReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type ProbeEventType

type ProbeEventType string

ProbeEventType defines the type of probe event.

const (
	ProbeEventOperationNotImpl ProbeEventType = "OperationNotImplemented"
	ProbeEventCheckRoleFailed  ProbeEventType = "checkRoleFailed"
	ProbeEventRoleInvalid      ProbeEventType = "roleInvalid"
	ProbeEventRoleChanged      ProbeEventType = "roleChanged"
	ProbeEventRoleUnChanged    ProbeEventType = "roleUnChanged"
)

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"`
}

func ParseProbeEventMessage

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

ParseProbeEventMessage parses probe event message.

type RoleChangeEventHandler

type RoleChangeEventHandler struct{}

RoleChangeEventHandler is the event handler for the role change event

func (*RoleChangeEventHandler) Handle

Handle handles role changed event.

Jump to

Keyboard shortcuts

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