Skip to content

Commit

Permalink
remove dead
Browse files Browse the repository at this point in the history
  • Loading branch information
skonto committed Apr 11, 2024
1 parent 8df6d21 commit 31ced74
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 24 deletions.
9 changes: 4 additions & 5 deletions pkg/reconciler/revision/reconcile_resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,10 @@ func (c *Reconciler) reconcileDeployment(ctx context.Context, rev *v1.Revision)
logger.Infof("marking revision resources unavailable with: %s: %s", w.Reason, w.Message)
rev.Status.MarkResourcesAvailableFalse(w.Reason, w.Message)
break
} else {
if shouldRequeue := rev.Status.PropagateDeploymentAvailabilityWithContainerStatus(&deployment.Status, w.Reason, w.Message); shouldRequeue {
// If we don't keep re-trying here at some point revision gets stuck without updates, thus not getting the latest.
return controller.NewRequeueAfter(requeuePeriodForProgressionChecking)
}
}
if shouldRequeue := rev.Status.PropagateDeploymentAvailabilityWithContainerStatus(&deployment.Status, w.Reason, w.Message); shouldRequeue {
// If we don't keep re-trying here at some point revision gets stuck without updates, thus not getting the latest.
return controller.NewRequeueAfter(requeuePeriodForProgressionChecking)
}
}
}
Expand Down
9 changes: 0 additions & 9 deletions pkg/testing/functional.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,6 @@ func WithBufferedTraffic(pa *autoscalingv1alpha1.PodAutoscaler) {
"Requests to the target are being buffered as resources are provisioned.")
}

// WithBufferedTrafficAllConditionsSet updates the PA to reflect that it has received
// and buffered traffic, it is not ready and waits for sks too.
func WithBufferedTrafficAllConditionsSet(pa *autoscalingv1alpha1.PodAutoscaler) {
pa.Status.MarkActivating("Queued",
"Requests to the target are being buffered as resources are provisioned.")
pa.Status.MarkSKSNotReady("K8s Service is not ready")
pa.Status.MarkScaleTargetInitialized()
}

// WithNoTraffic updates the PA to reflect the fact that it is not
// receiving traffic.
func WithNoTraffic(reason, message string) PodAutoscalerOption {
Expand Down
6 changes: 0 additions & 6 deletions pkg/testing/v1/revision.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,6 @@ func MarkInactive(reason, message string) RevisionOption {
}
}

func MarkActiveUknown(reason, message string) RevisionOption {
return func(r *v1.Revision) {
r.Status.MarkActiveUnknown(reason, message)
}
}

// MarkActivating calls .Status.MarkActivating on the Revision.
func MarkActivating(reason, message string) RevisionOption {
return func(r *v1.Revision) {
Expand Down
7 changes: 3 additions & 4 deletions test/conformance/api/v1/errorcondition_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,9 @@ func TestContainerExitingMsg(t *testing.T) {
}

t.Log("When the containers keep crashing, the Revision should have error status.")
err = v1test.CheckRevisionState(clients.ServingClient, names.Revision, func(r *v1.Revision) (bool, error) {
if err := v1test.WaitForRevisionState(clients.ServingClient, names.Revision, func(r *v1.Revision) (bool, error) {
cond := r.Status.GetCondition(v1.RevisionConditionReady)
t.Logf("Revsion %s Ready status = %v", names.Revision, cond)
t.Logf("Revision %s Ready status = %v", names.Revision, cond)
if cond != nil {
if cond.Reason != "" && cond.Message != "" {
return true, nil
Expand All @@ -171,8 +171,7 @@ func TestContainerExitingMsg(t *testing.T) {
names.Revision, cond.Reason, cond.Message)
}
return false, nil
})
if err != nil {
}, "RevisionContainersCrashing"); err != nil {
t.Fatal("Failed to validate revision state:", err)
}
}
Expand Down

0 comments on commit 31ced74

Please sign in to comment.