@@ -10,6 +10,7 @@ import (
1010 networkingv1 "k8s.io/api/networking/v1"
1111 policyv1 "k8s.io/api/policy/v1"
1212 "k8s.io/apimachinery/pkg/api/errors"
13+ "k8s.io/apimachinery/pkg/api/meta"
1314 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1415 "k8s.io/apimachinery/pkg/runtime"
1516 "k8s.io/apimachinery/pkg/types"
@@ -152,8 +153,22 @@ func (r *ServerReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctr
152153
153154 if ready > 0 {
154155 server .Status .Phase = openvoxv1alpha1 .ServerPhaseRunning
156+ meta .SetStatusCondition (& server .Status .Conditions , metav1.Condition {
157+ Type : openvoxv1alpha1 .ConditionServerReady ,
158+ Status : metav1 .ConditionTrue ,
159+ Reason : "ReplicasReady" ,
160+ Message : fmt .Sprintf ("%d/%d replicas ready" , ready , replicas ),
161+ LastTransitionTime : metav1 .Now (),
162+ })
155163 } else {
156164 server .Status .Phase = openvoxv1alpha1 .ServerPhasePending
165+ meta .SetStatusCondition (& server .Status .Conditions , metav1.Condition {
166+ Type : openvoxv1alpha1 .ConditionServerReady ,
167+ Status : metav1 .ConditionFalse ,
168+ Reason : "ReplicasNotReady" ,
169+ Message : fmt .Sprintf ("0/%d replicas ready" , replicas ),
170+ LastTransitionTime : metav1 .Now (),
171+ })
157172 }
158173 }); err != nil {
159174 return ctrl.Result {}, err
0 commit comments