common

package
v0.0.0-...-d7ecc2e Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// Event action describes what action was taken
	EventActionReconcile = "Reconcile"
	EventActionCreate    = "Create"
	EventActionUpdate    = "Update"
	EventActionDelete    = "Delete"
	EventActionProgress  = "Progress"
)
View Source
const (
	// Short, machine understandable string that gives the reason for the transition into the object's current status
	EventReasonReconcileStarted       = "ReconcileStarted"
	EventReasonReconcileInProgress    = "ReconcileInProgress"
	EventReasonReconcileCompleted     = "ReconcileCompleted"
	EventReasonReconcileFailed        = "ReconcileFailed"
	EventReasonCreateStarted          = "CreateStarted"
	EventReasonCreateInProgress       = "CreateInProgress"
	EventReasonCreateCompleted        = "CreateCompleted"
	EventReasonCreateFailed           = "CreateFailed"
	EventReasonUpdateStarted          = "UpdateStarted"
	EventReasonUpdateInProgress       = "UpdateInProgress"
	EventReasonUpdateCompleted        = "UpdateCompleted"
	EventReasonUpdateFailed           = "UpdateFailed"
	EventReasonDeleteStarted          = "DeleteStarted"
	EventReasonDeleteInProgress       = "DeleteInProgress"
	EventReasonDeleteCompleted        = "DeleteCompleted"
	EventReasonDeleteFailed           = "DeleteFailed"
	EventReasonProgressHostsCompleted = "ProgressHostsCompleted"
)

Variables

This section is empty.

Functions

func DumpStatefulSetDiff

func DumpStatefulSetDiff(host *api.Host, cur, new *apps.StatefulSet)

func GetObjectStatusFromMetas

func GetObjectStatusFromMetas(labeler interfaces.ILabeler, curMeta, newMeta meta.Object) api.ObjectStatus

GetObjectStatusFromMetas gets StatefulSet status from cur and new meta infos

func LogActionPlan

func LogActionPlan(ap *action_plan.ActionPlan)

LogActionPlan logs action plan

func LogCR

func LogCR(name string, cr api.ICustomResource)

LogCR writes a CR into the log

func LogOldAndNew

func LogOldAndNew(name string, old, new api.ICustomResource)

LogOldAndNew writes old and new CHIs into the log

Types

type Announcer

type Announcer struct {
	a.Announcer
	// contains filtered or unexported fields
}

Announcer handler all log/event/status messages going outside of controller/worker

func NewAnnouncer

func NewAnnouncer(eventEmitter interfaces.IEventEmitter, statusUpdater interfaces.IKubeCR) Announcer

NewAnnouncer creates new announcer

func (Announcer) A

func (a Announcer) A() Announcer

A adds full code address as 'file:line:function'

func (Announcer) E

func (a Announcer) E() Announcer

E adds 'end of the function' tag

func (Announcer) Error

func (a Announcer) Error(format string, args ...interface{})

Error is inspired by log.Errorf()

func (Announcer) F

func (a Announcer) F() Announcer

F adds function name

func (Announcer) FL

func (a Announcer) FL() Announcer

FL adds filename

func (Announcer) Fatal

func (a Announcer) Fatal(format string, args ...interface{})

Fatal is inspired by log.Fatalf()

func (Announcer) Info

func (a Announcer) Info(format string, args ...interface{})

Info is inspired by log.Infof()

func (Announcer) L

func (a Announcer) L() Announcer

L adds line number

func (Announcer) M

func (a Announcer) M(m ...interface{}) Announcer

M adds object meta as 'namespace/name'

func (Announcer) P

func (a Announcer) P()

P triggers log to print line

func (Announcer) S

func (a Announcer) S() Announcer

S adds 'start of the function' tag

func (Announcer) Silence

func (a Announcer) Silence() Announcer

Silence produces silent announcer

func (Announcer) V

func (a Announcer) V(level log.Level) Announcer

V is inspired by log.V()

func (Announcer) Warning

func (a Announcer) Warning(format string, args ...interface{})

Warning is inspired by log.Warningf()

func (Announcer) WithEvent

func (a Announcer) WithEvent(cr api.ICustomResource, action string, reason string) Announcer

WithEvent is used in chained calls in order to produce event into `chi`

func (Announcer) WithStatusAction

func (a Announcer) WithStatusAction(cr api.ICustomResource) Announcer

WithStatusAction is used in chained calls in order to produce action into `ClickHouseInstallation.Status.Action`

func (Announcer) WithStatusActions

func (a Announcer) WithStatusActions(cr api.ICustomResource) Announcer

WithStatusActions is used in chained calls in order to produce action in ClickHouseInstallation.Status.Actions

func (Announcer) WithStatusError

func (a Announcer) WithStatusError(cr api.ICustomResource) Announcer

WithStatusError is used in chained calls in order to produce error in ClickHouseInstallation.Status.Error

type ErrorCRUD

type ErrorCRUD error

ErrorCRUD specifies errors of the CRUD operations

var (
	ErrCRUDAbort          ErrorCRUD = errors.New("crud error - should abort")
	ErrCRUDIgnore         ErrorCRUD = errors.New("crud error - should ignore")
	ErrCRUDRecreate       ErrorCRUD = errors.New("crud error - should recreate")
	ErrCRUDUnexpectedFlow ErrorCRUD = errors.New("crud error - unexpected flow")
)

type EventEmitter

type EventEmitter struct {
	// contains filtered or unexported fields
}

func NewEventEmitter

func NewEventEmitter(
	kubeEvent interfaces.IKubeEvent,
	kind string,
	generateName string,
	component string,
) *EventEmitter

func (*EventEmitter) EventError

func (c *EventEmitter) EventError(obj meta.Object, action string, reason string, message string)

EventError emits event Error

func (*EventEmitter) EventInfo

func (c *EventEmitter) EventInfo(obj meta.Object, action string, reason string, message string)

EventInfo emits event Info

func (*EventEmitter) EventWarning

func (c *EventEmitter) EventWarning(obj meta.Object, action string, reason string, message string)

EventWarning emits event Warning

type ReconcileShardsAndHostsOptions

type ReconcileShardsAndHostsOptions struct {
	FullFanOut bool
}

ReconcileShardsAndHostsOptions is and options for reconciler

type ReconcileShardsAndHostsOptionsCtxKeyType

type ReconcileShardsAndHostsOptionsCtxKeyType string

ReconcileShardsAndHostsOptionsCtxKeyType specifies type for ReconcileShardsAndHostsOptionsCtxKey More details here on why do we need special type https://stackoverflow.com/questions/40891345/fix-should-not-use-basic-type-string-as-key-in-context-withvalue-golint

const ReconcileShardsAndHostsOptionsCtxKey ReconcileShardsAndHostsOptionsCtxKeyType = "ReconcileShardsAndHostsOptions"

ReconcileShardsAndHostsOptionsCtxKey specifies name of the key to be used for ReconcileShardsAndHostsOptions

type Task

type Task struct {
	// contains filtered or unexported fields
}

task represents context of a worker. This also can be called "a reconcile task"

func NewTask

func NewTask(creator interfaces.ICreator) *Task

NewTask creates new context

func (*Task) CmUpdate

func (t *Task) CmUpdate() time.Time

func (*Task) Creator

func (t *Task) Creator() interfaces.ICreator

func (*Task) RegistryFailed

func (t *Task) RegistryFailed() *model.Registry

func (*Task) RegistryReconciled

func (t *Task) RegistryReconciled() *model.Registry

func (*Task) SetCmUpdate

func (t *Task) SetCmUpdate(update time.Time)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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