Skip to content

Commit

Permalink
Add MachineSetReady condition to MchineDeployment
Browse files Browse the repository at this point in the history
  • Loading branch information
muraee committed Aug 22, 2023
1 parent 46412f0 commit 6560132
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
8 changes: 8 additions & 0 deletions api/v1beta1/condition_consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,14 @@ const (
// machines required (i.e. Spec.Replicas-MaxUnavailable when MachineDeploymentStrategyType = RollingUpdate) are up and running for at least minReadySeconds.
MachineDeploymentAvailableCondition ConditionType = "Available"

// MachineSetReadyCondition reports a summary of current status of the MachineSet owned by the MachineDeployment.
MachineSetReadyCondition ConditionType = "MachineSetReady"

// WaitingForMachineSetFallbackReason (Severity=Info) documents a MachineDeployment waiting for the underlying MachineSet
// to be available.
// NOTE: This reason is used only as a fallback when the MachineSet object is not reporting its own ready condition.
WaitingForMachineSetFallbackReason = "WaitingForMachineSet"

// WaitingForAvailableMachinesReason (Severity=Warning) reflects the fact that the required minimum number of machines for a machinedeployment are not available.
WaitingForAvailableMachinesReason = "WaitingForAvailableMachines"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,13 @@ func calculateStatus(allMSs []*clusterv1.MachineSet, newMS *clusterv1.MachineSet
}
}
}

// Report a summary of current status of the MachineSet object owned by this MachineDeployment.
conditions.SetMirror(deployment, clusterv1.MachineSetReadyCondition,
newMS,
conditions.WithFallbackValue(false, clusterv1.WaitingForMachineSetFallbackReason, clusterv1.ConditionSeverityInfo, ""),
)

return status
}

Expand Down

0 comments on commit 6560132

Please sign in to comment.