readiness

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package readiness computes per-component pod readiness for a Helm release. Poll is the single source of truth, backing both the live-updating summary deployah.dev/deployah/internal/cmd/deploy.DeployWatcher prints during a deploy and the one-shot summary printed when a deploy is skipped because nothing changed.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllReady

func AllReady(statuses []ComponentStatus) bool

AllReady reports whether every component in statuses has all of its pods ready. It returns false for an empty slice: no data is not the same as "ready".

func IsPodReady

func IsPodReady(pod *corev1.Pod) bool

IsPodReady reports whether pod is running and every container inside it reports ready.

func Summary

func Summary(statuses []ComponentStatus) string

Summary formats statuses as a comma-separated "name: ready/total" list, e.g. "api: 2/2, worker: 1/2". It returns "" for an empty slice.

Types

type ComponentStatus

type ComponentStatus struct {
	// Name is the component name from the Deployah spec.
	Name string
	// ReadyPods is the number of pods that passed readiness checks.
	ReadyPods int
	// TotalPods is the total number of pods for this component.
	TotalPods int
}

ComponentStatus summarizes pod readiness for one Deployah component.

func Poll

func Poll(ctx context.Context, k8sClient kubernetes.Interface, namespace, releaseName string) ([]ComponentStatus, error)

Poll lists the pods belonging to releaseName in namespace and groups them by Deployah component (falling back to the standard "app.kubernetes.io/component" label, then the release name itself, when a pod carries neither), counting how many of each component's pods are ready per IsPodReady.

Jump to

Keyboard shortcuts

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