hibernation

package
v1.23.0 Latest Latest
Warning

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

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

Documentation

Overview

Package hibernation contains all the logic to hibernate a CNPG cluster

Index

Constants

View Source
const (
	// HibernationOff is the shadow of utils.HibernationAnnotationValueOff, for compatibility
	HibernationOff = string(utils.HibernationAnnotationValueOff)

	// HibernationOn is the shadow of utils.HibernationAnnotationValueOn, for compatibility
	HibernationOn = string(utils.HibernationAnnotationValueOn)
)
View Source
const (
	// HibernationConditionType is the name of the condition representing
	// the hibernation status
	HibernationConditionType = "cnpg.io/hibernation"

	// HibernationConditionReasonWrongAnnotationValue is the value of the hibernation
	// condition that is used when the value of the annotation is not correct
	HibernationConditionReasonWrongAnnotationValue = "WrongAnnotationValue"

	// HibernationConditionReasonHibernated is the value of the hibernation
	// condition that is used when the cluster is hibernated
	HibernationConditionReasonHibernated = "Hibernated"

	// HibernationConditionReasonDeletingPods is the value of the hibernation
	// condition that is used when the operator is deleting
	// the cluster's Pod
	HibernationConditionReasonDeletingPods = "DeletingPods"

	// HibernationConditionReasonWaitingPodsDeletion is the value of the
	// hibernation condition that is used when the operator is waiting for a Pod
	// to be deleted
	HibernationConditionReasonWaitingPodsDeletion = "WaitingPodsDeletion"
)

Variables

This section is empty.

Functions

func EnrichStatus

func EnrichStatus(
	_ context.Context,
	cluster *apiv1.Cluster,
	podList []corev1.Pod,
)

EnrichStatus obtains and classifies the hibernation status of the cluster

func Reconcile

func Reconcile(
	ctx context.Context,
	c client.Client,
	cluster *apiv1.Cluster,
	instances []corev1.Pod,
) (*ctrl.Result, error)

Reconcile reconciles the cluster hibernation status.

Types

type ErrInvalidHibernationValue

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

ErrInvalidHibernationValue is raised when the hibernation annotation has an invalid value

func (*ErrInvalidHibernationValue) Error

func (err *ErrInvalidHibernationValue) Error() string

Error implements the error interface

Jump to

Keyboard shortcuts

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