hibernation

package
v1.30.2 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: Apache-2.0 Imports: 12 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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"

	// HibernationConditionReasonWaitingForHealthy is the value of the
	// hibernation condition that is used when the cluster is not healthy
	// and hibernation cannot proceed yet
	HibernationConditionReasonWaitingForHealthy = "WaitingForHealthy"
)

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