status

package
v1.76.6 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// ConditionRequirementsMet indicates package requirements validation passed
	ConditionRequirementsMet ConditionType = "RequirementsMet"
	// ConditionReadyOnFilesystem indicates package was successfully mounted and accessible
	ConditionReadyOnFilesystem ConditionType = "ReadyOnFilesystem"
	// ConditionLoaded indicates package is loaded in runtime
	ConditionLoaded ConditionType = "Loaded"
	// ConditionHooksProcessed indicates all package hooks executed successfully
	ConditionHooksProcessed ConditionType = "HooksProcessed"
	// ConditionManifestsApplied indicates Helm release was successfully applied
	ConditionManifestsApplied ConditionType = "ManifestsApplied"
	// ConditionScaled checks the cluster resources are ready
	ConditionScaled ConditionType = "Scaled"
	// ConditionConfigured checks the settings passed openAPI validation
	ConditionConfigured ConditionType = "Configured"
	// ConditionPending indicates that the package wait converge
	ConditionPending ConditionType = "Pending"

	// ConditionReasonApplyingManifests indicates that nelm is applying manifests to the cluster
	ConditionReasonApplyingManifests ConditionReason = "ApplyingManifests"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Condition

type Condition struct {
	Type    ConditionType          `json:"type"`
	Status  metav1.ConditionStatus `json:"status"` // true = condition met, false = condition failed
	Reason  ConditionReason        `json:"reason,omitempty"`
	Message string                 `json:"message,omitempty"`
}

Condition represents a single status condition for a package

type ConditionReason

type ConditionReason string

type ConditionType

type ConditionType string

type Error

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

Error wraps an error with associated status conditions Used to propagate both error details and status updates through the call stack

func NewError added in v1.76.1

func NewError(reason ConditionReason, err error) *Error

func (*Error) Error

func (e *Error) Error() string

type Service

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

Service tracks package statuses and notifies listeners of changes

func NewService

func NewService() *Service

func (*Service) ClearStatus added in v1.76.1

func (s *Service) ClearStatus(name string)

ClearStatus creates a new status or resets conditions. If a health event was buffered by UpdateHealth before this name was registered, it is applied here and the buffer entry is dropped.

func (*Service) DeleteStatus added in v1.76.1

func (s *Service) DeleteStatus(name string)

DeleteStatus removes a package status from tracking Should be called when a package is deleted to prevent memory leaks

func (*Service) GetStatus

func (s *Service) GetStatus(name string) Status

GetStatus retrieves a copy of the current status for a package by name ("namespace.name") Returns a copy to prevent race conditions with concurrent modifications

func (*Service) HandleError

func (s *Service) HandleError(name string, cond ConditionType, err error)

HandleError processes an error and extracts status conditions from it Notifies listeners if any conditions changed

func (*Service) Queue added in v1.76.1

Queue returns the notification queue. Consumers pull changed package names via Get/Done and requeue transient failures via AddRateLimited.

func (*Service) SetConditionFalse added in v1.76.0

func (s *Service) SetConditionFalse(name string, condition ConditionType, reason, message string)

SetConditionFalse marks a condition as successful and notifies listeners if changed

func (*Service) SetConditionTrue

func (s *Service) SetConditionTrue(name string, condition ConditionType)

SetConditionTrue marks a condition as successful and notifies listeners if changed

func (*Service) Shutdown added in v1.76.1

func (s *Service) Shutdown()

Shutdown stops the notification queue; the consumer loop exits on the next Get.

func (*Service) UpdateHealth added in v1.76.1

func (s *Service) UpdateHealth(name string, event health.Event)

UpdateHealth applies a workload-health transition to ConditionScaled. State mapping to K8s condition status:

StateScaled                          → True,    Reason="Scaled"
StateReconciling, StateDegraded      → False,   Reason=State, Message=workload detail
StateUnknown                         → Unknown, Reason="" (no workloads to observe)

If the package is not yet tracked by the service, the event is buffered and applied by the next ClearStatus call for the same name. This closes the startup race in which the health monitor observes workloads before the package is registered.

func (*Service) UpdateSettings added in v1.76.0

func (s *Service) UpdateSettings(name string, settings addonutils.Values)

UpdateSettings stores the effective settings of a package. Does not notify — the caller pairs this with SetConditionTrue which notifies.

func (*Service) UpdateTracking added in v1.76.0

func (s *Service) UpdateTracking(name string, report progrep.ProgressReport)

UpdateTracking updates the nelm progress report for a package and notifies listeners. If the package is not tracked by the service, the update is silently ignored.

func (*Service) UpdateVersion added in v1.76.1

func (s *Service) UpdateVersion(name string, version string)

UpdateVersion sets the current version of package

type Status

type Status struct {
	Version    string            `json:"version"`
	Conditions []Condition       `json:"conditions"`
	Tracking   Tracking          `json:"tracking"`
	Settings   addonutils.Values `json:"settings,omitempty"`
}

Status represents the current state of a package

func (*Status) IsConditionTrue added in v1.76.1

func (s *Status) IsConditionTrue(condType ConditionType) bool

IsConditionTrue returns true if the condition status is True

type Tracking added in v1.76.0

type Tracking struct {
	Completed int                 `json:"completed"`
	Remaining int                 `json:"remaining"`
	Report    progrep.StageReport `json:"report"`
}

Jump to

Keyboard shortcuts

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