Documentation
¶
Overview ¶
Package monitor provides functionality for monitoring and updating the status of a bundle deployment. It includes functions for determining whether the agent should be redeployed, whether the status should be updated, and for updating the status based on the resources and helm release history.
Index ¶
- Variables
- func ShouldRedeployAgent(bd *fleet.BundleDeployment) bool
- func ShouldUpdateStatus(bd *fleet.BundleDeployment) bool
- type Cond
- func (c Cond) False(obj interface{})
- func (c Cond) GetMessage(obj interface{}) string
- func (c Cond) GetReason(obj interface{}) string
- func (c Cond) IsFalse(obj interface{}) bool
- func (c Cond) IsTrue(obj interface{}) bool
- func (c Cond) Message(obj interface{}, message string)
- func (c Cond) Reason(obj interface{}, reason string)
- func (c Cond) SetError(obj interface{}, reason string, err error)
- func (c Cond) True(obj interface{})
- type Monitor
Constants ¶
This section is empty.
Variables ¶
var ErrSkip = controller.ErrIgnore
Functions ¶
func ShouldRedeployAgent ¶
func ShouldRedeployAgent(bd *fleet.BundleDeployment) bool
func ShouldUpdateStatus ¶
func ShouldUpdateStatus(bd *fleet.BundleDeployment) bool
ShouldUpdateStatus skips resource and ready status updates if the bundle deployment is unchanged or not installed yet.
Types ¶
type Cond ¶ added in v0.11.0
type Cond string
func (Cond) GetMessage ¶ added in v0.11.0
type Monitor ¶
type Monitor struct {
// contains filtered or unexported fields
}
func New ¶
func New(client client.Client, ds *desiredset.Client, deployer *helmdeployer.Helm, defaultNamespace string, labelSuffix string) *Monitor
func (*Monitor) UpdateStatus ¶
func (m *Monitor) UpdateStatus(ctx context.Context, bd *fleet.BundleDeployment, resources *helmdeployer.Resources) (fleet.BundleDeploymentStatus, error)
UpdateStatus sets the status of the bundledeployment based on the resources from the helm release history and the live state. In the status it updates: Ready, NonReadyStatus, IncompleteState, NonReadyStatus, NonModified, ModifiedStatus, Resources and ResourceCounts fields. Additionally it sets the Ready condition either from the NonReadyStatus or the NonModified status field.