Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/go_modules/google.golang.org/gr…
Browse files Browse the repository at this point in the history
…pc-1.56.3
  • Loading branch information
satr authored Nov 7, 2023
2 parents 6f110b1 + dc59ea4 commit c80598f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion api/deployments/models/component_deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,12 @@ type ReplicaSummary struct {
// example: 2006-01-02T15:04:05Z
Created string `json:"created"`

// Container started timestamp
//
// required: false
// example: 2006-01-02T15:04:05Z
ContainerStarted string `json:"containerStarted,omitempty"`

// Status describes the component container status
//
// required: false
Expand Down Expand Up @@ -338,7 +344,7 @@ func GetReplicaSummary(pod corev1.Pod) ReplicaSummary {
// Set default Pending status
replicaSummary.Status = ReplicaStatus{Status: Pending.String()}

if len(pod.Status.ContainerStatuses) <= 0 {
if len(pod.Status.ContainerStatuses) == 0 {
condition := getLastReadyCondition(pod.Status.Conditions)
if condition != nil {
replicaSummary.Status = ReplicaStatus{Status: getReplicaStatusByPodStatus(pod.Status.Phase)}
Expand All @@ -357,6 +363,7 @@ func GetReplicaSummary(pod corev1.Pod) ReplicaSummary {
}
}
if containerState.Running != nil {
replicaSummary.ContainerStarted = radixutils.FormatTimestamp(containerState.Running.StartedAt.Time)
if containerStatus.Ready {
replicaSummary.Status = ReplicaStatus{Status: Running.String()}
} else {
Expand Down

0 comments on commit c80598f

Please sign in to comment.