Skip to content

Commit

Permalink
consider default cni status in ready condition except for when skip u…
Browse files Browse the repository at this point in the history
…pgrades reason
  • Loading branch information
cxbrowne1207 authored and eks-distro-pr-bot committed Dec 6, 2023
1 parent a28d3c7 commit cb9d68a
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions controllers/cluster_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -437,13 +437,23 @@ func (r *ClusterReconciler) updateStatus(ctx context.Context, log logr.Logger, c

clusters.UpdateClusterStatusForCNI(ctx, cluster)

summarizedConditionTypes := []anywherev1.ConditionType{
anywherev1.ControlPlaneInitializedCondition,
anywherev1.ControlPlaneReadyCondition,
anywherev1.WorkersReadyCondition,
}

defaultCNIConfiguredCondition := conditions.Get(cluster, anywherev1.DefaultCNIConfiguredCondition)
if defaultCNIConfiguredCondition == nil ||
(defaultCNIConfiguredCondition != nil &&
defaultCNIConfiguredCondition.Status == "False" &&
defaultCNIConfiguredCondition.Reason != anywherev1.SkipUpgradesForDefaultCNIConfiguredReason) {
summarizedConditionTypes = append(summarizedConditionTypes, anywherev1.DefaultCNIConfiguredCondition)
}

// Always update the readyCondition by summarizing the state of other conditions.
conditions.SetSummary(cluster,
conditions.WithConditions(
anywherev1.ControlPlaneInitializedCondition,
anywherev1.ControlPlaneReadyCondition,
anywherev1.WorkersReadyCondition,
),
conditions.WithConditions(summarizedConditionTypes...),
)

return nil
Expand Down

0 comments on commit cb9d68a

Please sign in to comment.