condition

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: Apache-2.0 Imports: 10 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, etcd druidv1alpha1.Etcd) Result
}

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

func AllMembersReadyCheck

func AllMembersReadyCheck(_ client.Client) Checker

AllMembersReadyCheck returns a check for the "AllMembersReady" condition.

func BackupReadyCheck

func BackupReadyCheck(cl client.Client) Checker

BackupReadyCheck returns a check for the "BackupReady" condition.

func DataVolumesReadyCheck

func DataVolumesReadyCheck(cl client.Client) Checker

DataVolumesReadyCheck returns a check for the "DataVolumesReady" 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