serving icon indicating copy to clipboard operation
serving copied to clipboard

kpa: simplify computeActiveCondition logic

Open andrew-delph opened this issue 1 year ago • 2 comments

Making changes to the pa active status has becomes difficult. This change breaks down some of the logic so that it is more readable. No changes to test cases were made as it doesn't actually change the logical cases.

This pr is created from the comments found here: https://github.com/knative/serving/pull/14607#discussion_r1493156424

andrew-delph avatar Feb 24 '24 01:02 andrew-delph

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: andrew-delph Once this PR has been reviewed and has the lgtm label, please assign dprotaso for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

knative-prow[bot] avatar Feb 24 '24 01:02 knative-prow[bot]

Hi @andrew-delph. Thanks for your PR.

I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

knative-prow[bot] avatar Feb 24 '24 01:02 knative-prow[bot]

/ok-to-test

dprotaso avatar Feb 24 '24 17:02 dprotaso

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 84.23%. Comparing base (64b7126) to head (df191b8). Report is 56 commits behind head on main.

:exclamation: Current head df191b8 differs from pull request most recent head 351d7d9. Consider uploading reports for the commit 351d7d9 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #14940      +/-   ##
==========================================
+ Coverage   84.22%   84.23%   +0.01%     
==========================================
  Files         213      213              
  Lines       16635    16641       +6     
==========================================
+ Hits        14011    14018       +7     
- Misses       2278     2279       +1     
+ Partials      346      344       -2     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Feb 24 '24 17:02 codecov[bot]

If this fixes a problem can you add a test (unit or e2e) that demonstrates it?

dprotaso avatar Feb 26 '24 01:02 dprotaso

The failures seem legit. The original test surfaces ensures we surface image pull failure as the err message.

image_pull_error_test.go:86: Failed to validate revision state: the Revision image-pull-error-bikcsjns-00001 ReadyCondition = (Reason="ProgressDeadlineExceeded", Message="Initial scale was never achieved"), wantReasons: [ImagePullBackOff ErrImagePull]

dprotaso avatar Mar 04 '24 03:03 dprotaso

Hello @dprotaso , I added a unit test to cover the image pull error caught in the e2e tests and updated the code.

andrew-delph avatar Mar 14 '24 21:03 andrew-delph