health

package
v2.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2024 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDoguChecker

func NewDoguChecker(ecosystemClient ecoSystem.EcoSystemV2Interface, localFetcher localDoguFetcher) *doguChecker

NewDoguChecker creates a checker for dogu health.

Types

type AvailabilityChecker

type AvailabilityChecker struct{}

func (*AvailabilityChecker) IsAvailable

func (ac *AvailabilityChecker) IsAvailable(deployment *appsv1.Deployment) bool

IsAvailable checks whether the deployment has reached its desired state and is available.

type DeploymentAvailabilityChecker

type DeploymentAvailabilityChecker interface {
	// IsAvailable checks whether the deployment has reached its desired state and is available.
	IsAvailable(deployment *appsv1.Deployment) bool
}

type DoguHealthError

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

DoguHealthError is a dogu validation error. Instances can be unwrapped. Instances can be type asserted.

func NewDoguHealthError

func NewDoguHealthError(err error) *DoguHealthError

NewDoguHealthError creates a new dogu health error.

func (*DoguHealthError) Error

func (dhe *DoguHealthError) Error() string

Error returns the full error message as string.

func (*DoguHealthError) Unwrap

func (dhe *DoguHealthError) Unwrap() error

Unwrap returns the original error.

type DoguHealthStatusUpdater

type DoguHealthStatusUpdater interface {
	// UpdateStatus sets the health status of the dogu according to whether if it's available or not.
	UpdateStatus(ctx context.Context, doguName types.NamespacedName, available bool) error
	UpdateHealthConfigMap(ctx context.Context, deployment *appsv1.Deployment, doguJson *cesappcore.Dogu) error
}

type DoguStatusUpdater

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

func NewDoguStatusUpdater

func NewDoguStatusUpdater(ecosystemClient ecoSystem.EcoSystemV2Interface, recorder record.EventRecorder, k8sClientSet clientSet) *DoguStatusUpdater

func (*DoguStatusUpdater) UpdateHealthConfigMap

func (dsw *DoguStatusUpdater) UpdateHealthConfigMap(ctx context.Context, doguDeployment *appsv1.Deployment, doguJson *cesappcore.Dogu) error

func (*DoguStatusUpdater) UpdateStatus

func (dsw *DoguStatusUpdater) UpdateStatus(ctx context.Context, doguName types.NamespacedName, isAvailable bool) error

UpdateStatus sets the health status of the dogu according to whether if it's available or not.

type ShutdownHandler

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

func NewShutdownHandler

func NewShutdownHandler(doguInterface ecoSystem.DoguInterface) *ShutdownHandler

func (*ShutdownHandler) Start

func (s *ShutdownHandler) Start(ctx context.Context) error

type StartupHandler

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

func NewStartupHandler

func NewStartupHandler(doguInterface ecoSystem.DoguInterface, deploymentInterface v1.DeploymentInterface,
	availabilityChecker DeploymentAvailabilityChecker, healthUpdater DoguHealthStatusUpdater) *StartupHandler

func (*StartupHandler) Start

func (s *StartupHandler) Start(ctx context.Context) error

Jump to

Keyboard shortcuts

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