Skip to content

Commit

Permalink
handle missing k8s deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard87 committed Aug 27, 2024
1 parent c62637e commit c8911ab
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions api/models/component.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,12 +240,12 @@ func certificateRequestConditionReady(condition cmv1.CertificateRequestCondition
}

func getComponentStatus(component radixv1.RadixCommonDeployComponent, kd *appsv1.Deployment, rd *radixv1.RadixDeployment, pods []corev1.Pod) deploymentModels.ComponentStatus {
var replicasUnavailable, replicasReady, replicas int32
if kd != nil {
replicasUnavailable = kd.Status.UnavailableReplicas
replicasReady = kd.Status.ReadyReplicas
replicas = pointers.Val(kd.Spec.Replicas)
if kd == nil {
return deploymentModels.ComponentReconciling
}
replicasUnavailable := kd.Status.UnavailableReplicas
replicasReady := kd.Status.ReadyReplicas
replicas := pointers.Val(kd.Spec.Replicas)

if component.GetType() == radixv1.RadixComponentTypeJob && replicas == 0 {
return deploymentModels.StoppedComponent
Expand Down

0 comments on commit c8911ab

Please sign in to comment.