Documentation
¶
Index ¶
- Constants
- type Condition
- type ConditionReason
- type ConditionType
- type Error
- type Service
- func (s *Service) ClearRuntimeConditions(name string)
- func (s *Service) Delete(name string)
- func (s *Service) GetCh() <-chan string
- func (s *Service) GetStatus(name string) Status
- func (s *Service) HandleError(name string, err error)
- func (s *Service) SetConditionFalse(name string, condition ConditionType, reason, message string)
- func (s *Service) SetConditionTrue(name string, condition ConditionType)
- func (s *Service) SetVersion(name string, version string)
- func (s *Service) UpdateSettings(name string, settings addonutils.Values)
- func (s *Service) UpdateTracking(name string, report progrep.ProgressReport)
- type Status
- type Tracking
Constants ¶
const ( // ConditionRequirementsMet indicates package requirements validation passed ConditionRequirementsMet ConditionType = "RequirementsMet" // ConditionDownloaded indicates package image was successfully downloaded from registry ConditionDownloaded ConditionType = "Downloaded" // ConditionReadyOnFilesystem indicates package was successfully mounted and accessible ConditionReadyOnFilesystem ConditionType = "ReadyOnFilesystem" // ConditionReadyInRuntime indicates package is fully loaded and operational in runtime ConditionReadyInRuntime ConditionType = "ReadyInRuntime" // ConditionHooksProcessed indicates all package hooks executed successfully ConditionHooksProcessed ConditionType = "HooksProcessed" // ConditionHelmApplied indicates Helm release was successfully applied ConditionHelmApplied ConditionType = "HelmApplied" // ConditionReadyInCluster checks the resources are ready ConditionReadyInCluster ConditionType = "ReadyInCluster" // ConditionSettingsValid checks the settings passed openAPI validation ConditionSettingsValid ConditionType = "SettingsValid" // ConditionWaitConverge indicates that the package wait converge ConditionWaitConverge ConditionType = "WaitConverge" // ConditionReasonManifestsApply indicates that nelm is applying manifests to the cluster ConditionReasonManifestsApply ConditionReason = "ManifestsApply" )
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 ¶
Error wraps an error with associated status conditions Used to propagate both error details and status updates through the call stack
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) ClearRuntimeConditions ¶
ClearRuntimeConditions sets runtime conditions to unknown
func (*Service) Delete ¶
Delete removes a package status from tracking Should be called when a package is deleted to prevent memory leaks
func (*Service) GetCh ¶
GetCh returns a read-only channel that receives package names when their status changes
func (*Service) GetStatus ¶
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 ¶
HandleError processes an error and extracts status conditions from it Notifies listeners if any conditions changed
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) SetVersion ¶
SetVersion sets the current version of package
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.