Skip to content

Commit

Permalink
Correct status for scaled down deployments.
Browse files Browse the repository at this point in the history
This change ensures that when persistent agent, scheduled workflow, and
api server deployments are scaled down, the owning DSPA displays their
status "Available" as "false".

Signed-off-by: Humair Khan <humair88@hotmail.com>
  • Loading branch information
HumairAK committed May 18, 2023
1 parent f0d4527 commit 4c7dcac
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions controllers/dspipeline_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ func (r *DSPAReconciler) isDeploymentAvailable(ctx context.Context, dspa *dspav1

err := r.Get(ctx, types.NamespacedName{Name: component, Namespace: dspa.Namespace}, found)
if err == nil {
if found.Spec.Replicas != nil && *found.Spec.Replicas == 0 {
return false
}
for _, s := range found.Status.Conditions {
if s.Type == "Available" && s.Status == corev1.ConditionTrue {
return true
Expand Down

0 comments on commit 4c7dcac

Please sign in to comment.