factory

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateOrUpdateClientService

func CreateOrUpdateClientService(
	ctx context.Context,
	cluster *etcdaenixiov1alpha1.EtcdCluster,
	rclient client.Client,
	rscheme *runtime.Scheme,
) error

func CreateOrUpdateClusterStateConfigMap

func CreateOrUpdateClusterStateConfigMap(
	ctx context.Context,
	cluster *etcdaenixiov1alpha1.EtcdCluster,
	rclient client.Client,
	rscheme *runtime.Scheme,
) error

func CreateOrUpdateHeadlessService added in v0.2.0

func CreateOrUpdateHeadlessService(
	ctx context.Context,
	cluster *etcdaenixiov1alpha1.EtcdCluster,
	rclient client.Client,
	rscheme *runtime.Scheme,
) error

func CreateOrUpdatePdb added in v0.1.0

func CreateOrUpdatePdb(
	ctx context.Context,
	cluster *etcdaenixiov1alpha1.EtcdCluster,
	rclient client.Client,
	rscheme *runtime.Scheme,
) error

func CreateOrUpdateStatefulSet

func CreateOrUpdateStatefulSet(
	ctx context.Context,
	cluster *etcdaenixiov1alpha1.EtcdCluster,
	rclient client.Client,
	rscheme *runtime.Scheme,
) error

func FillConditions

func FillConditions(cluster *etcdaenixiov1alpha1.EtcdCluster)

FillConditions fills EtcdCluster .status.Conditions list with all available conditions in "False" status.

func GetClusterStateConfigMapName

func GetClusterStateConfigMapName(cluster *etcdaenixiov1alpha1.EtcdCluster) string

func GetCondition

func GetCondition(cluster *etcdaenixiov1alpha1.EtcdCluster, condType string) *metav1.Condition

GetCondition returns condition from cluster status conditions by type or nil if not present.

func GetHeadlessServiceName added in v0.2.0

func GetHeadlessServiceName(cluster *etcdaenixiov1alpha1.EtcdCluster) string

func GetPVCName

func GetPVCName(cluster *etcdaenixiov1alpha1.EtcdCluster) string

func GetServiceName added in v0.2.0

func GetServiceName(cluster *etcdaenixiov1alpha1.EtcdCluster) string

func SetCondition

func SetCondition(
	cluster *etcdaenixiov1alpha1.EtcdCluster,
	condition metav1.Condition,
)

SetCondition sets either replaces corresponding existing condition in the .status.Conditions list or appends one passed as an argument. In case operation will not result into condition status change, return.

Types

type Condition

type Condition struct {
	metav1.Condition
}

Condition is a wrapper over metav1.Condition type.

func NewCondition

func NewCondition(conditionType etcdaenixiov1alpha1.EtcdCondType) Condition

NewCondition returns Condition object with provided condition type.

func (Condition) Complete

func (c Condition) Complete() metav1.Condition

Complete finalizes condition building by setting transition timestamp and returns wrapped metav1.Condition object.

func (Condition) WithMessage

func (c Condition) WithMessage(message string) Condition

WithMessage sets condition message.

func (Condition) WithReason

func (c Condition) WithReason(reason string) Condition

WithReason sets condition reason.

func (Condition) WithStatus

func (c Condition) WithStatus(status bool) Condition

WithStatus converts boolean value passed as an argument to metav1.ConditionStatus type and sets condition status.

type LabelsBuilder

type LabelsBuilder map[string]string

func NewLabelsBuilder

func NewLabelsBuilder() LabelsBuilder

func (LabelsBuilder) WithInstance

func (b LabelsBuilder) WithInstance(name string) LabelsBuilder

func (LabelsBuilder) WithManagedBy

func (b LabelsBuilder) WithManagedBy() LabelsBuilder

func (LabelsBuilder) WithName

func (b LabelsBuilder) WithName() LabelsBuilder

Jump to

Keyboard shortcuts

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