condition

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2024 License: Apache-2.0, MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// BackupSucceeded is a constant that means that etcd backup has been successfully taken
	BackupSucceeded string = "BackupSucceeded"
	// BackupFailed is a constant that means that etcd backup has failed
	BackupFailed string = "BackupFailed"
	// Unknown is a constant that means that the etcd backup status is currently not known
	Unknown string = "Unknown"
	// NotChecked is a constant that means that the etcd backup status has not been updated or rechecked
	NotChecked string = "NotChecked"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

type Builder interface {
	WithOldConditions(conditions []druidv1alpha1.Condition) Builder
	WithResults(result []Result) Builder
	WithNowFunc(now func() metav1.Time) Builder
	Build(replicas int32) []druidv1alpha1.Condition
}

Builder is an interface for building conditions.

func NewBuilder

func NewBuilder() Builder

NewBuilder returns a Builder for a specific condition.

type Checker

type Checker interface {
	Check(ctx context.Context, logger logr.Logger, etcd druidv1alpha1.Etcd) Result
}

Checker is an interface to check the etcd resource and to return condition results.

func AllMembersCheck

func AllMembersCheck(_ client.Client) Checker

AllMembersCheck returns a check for the "AllMembersReady" condition.

func BackupReadyCheck added in v0.11.0

func BackupReadyCheck(cl client.Client) Checker

BackupReadyCheck returns a check for the "BackupReady" condition.

func ReadyCheck

func ReadyCheck(_ client.Client) Checker

ReadyCheck returns a check for the "Ready" condition.

type Result

type Result interface {
	ConditionType() druidv1alpha1.ConditionType
	Status() druidv1alpha1.ConditionStatus
	Reason() string
	Message() string
}

Result encapsulates a condition result

Jump to

Keyboard shortcuts

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