Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/apis/serving/v1/revision_lifecycle.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ func (rs *RevisionStatus) PropagateDeploymentStatus(original *appsv1.DeploymentS

// PropagateAutoscalerStatus propagates autoscaler's status to the revision's status.
func (rs *RevisionStatus) PropagateAutoscalerStatus(ps *autoscalingv1alpha1.PodAutoscalerStatus) {
resUnavailable := rs.GetCondition(RevisionConditionResourcesAvailable).IsFalse()
resUnavailable := rs.GetCondition(RevisionConditionResourcesAvailable).IsFalse() || rs.GetCondition(RevisionConditionContainerHealthy).IsFalse()

// Reflect the PA status in our own.
cond := ps.GetCondition(autoscalingv1alpha1.PodAutoscalerConditionReady)
Expand Down
6 changes: 4 additions & 2 deletions pkg/reconciler/revision/reconcile_resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,21 +95,23 @@ func (c *Reconciler) reconcileDeployment(ctx context.Context, rev *v1.Revision)
}

for _, status := range pod.Status.ContainerStatuses {
if status.Name == rev.Spec.GetContainer().Name {
if status.Name != resources.QueueContainerName {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'll need to adjust the break on line 123. Otherwise if the failing sidecar container is second in the containerStatuses list it won't fail.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we don't need to use break anymore, but I changed the position of break for fast fail.

if t := status.LastTerminationState.Terminated; t != nil {
logger.Infof("marking exiting with: %d/%s", t.ExitCode, t.Message)
if t.ExitCode == 0 && t.Message == "" {
// In cases where there is no error message, we should still provide some exit message in the status
rev.Status.MarkContainerHealthyFalse(v1.ExitCodeReason(t.ExitCode),
v1.RevisionContainerExitingMessage("container exited with no error"))
break
} else {
rev.Status.MarkContainerHealthyFalse(v1.ExitCodeReason(t.ExitCode), v1.RevisionContainerExitingMessage(t.Message))
break
}
} else if w := status.State.Waiting; w != nil && hasDeploymentTimedOut(deployment) {
logger.Infof("marking resources unavailable with: %s: %s", w.Reason, w.Message)
rev.Status.MarkResourcesAvailableFalse(w.Reason, w.Message)
break
}
break
}
}
}
Expand Down