Skip to content

Commit

Permalink
Add documentation to functions and const
Browse files Browse the repository at this point in the history
  • Loading branch information
jsanin committed Jan 31, 2024
1 parent 1218843 commit b570ea6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/apis/autoscaling/v1alpha1/pa_lifecycle.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ func (pa *PodAutoscaler) ProgressDeadline() (time.Duration, bool) {
return pa.annotationDuration(serving.ProgressDeadlineAnnotation)
}

// RevisionTimeout returns the revision timeout annotation value, or false if not present.
func (pa *PodAutoscaler) RevisionTimeout() (time.Duration, bool) {
return pa.annotationDuration(serving.RevisionTimeoutAnnotation)
}
Expand All @@ -191,6 +192,8 @@ func (pa *PodAutoscaler) IsReady() bool {
pas.GetCondition(PodAutoscalerConditionReady).IsTrue()
}

// CanFailActivationOnUnreachableRevision checks whether the pod autoscaler is Unreachable and has been activating
// for at least the specified idle period
func (pa *PodAutoscaler) CanFailActivationOnUnreachableRevision(now time.Time, idlePeriod time.Duration) bool {
return pa.Spec.Reachability == ReachabilityUnreachable && pa.Status.CanFailActivation(now, idlePeriod)
}
Expand Down
1 change: 1 addition & 0 deletions pkg/apis/serving/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ const (
// ProgressDeadlineAnnotationKey is the label key for the per revision progress deadline to set for the deployment
ProgressDeadlineAnnotationKey = GroupName + "/progress-deadline"

// RevisionTimeoutAnnotationKey is the label key for the revision timeout to set for the pod autoscaler
RevisionTimeoutAnnotationKey = GroupName + "/revision-timeout"
)

Expand Down
1 change: 1 addition & 0 deletions pkg/reconciler/autoscaling/kpa/scaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ func (ks *scaler) applyScale(ctx context.Context, pa *autoscalingv1alpha1.PodAut
func (ks *scaler) scale(ctx context.Context, pa *autoscalingv1alpha1.PodAutoscaler, sks *netv1alpha1.ServerlessService, desiredScale int32) (int32, error) {
asConfig := config.FromContext(ctx).Autoscaler
logger := logging.FromContext(ctx)

if desiredScale < 0 && !pa.Status.IsActivating() {
logger.Debug("Metrics are not yet being collected.")
return desiredScale, nil
Expand Down

0 comments on commit b570ea6

Please sign in to comment.