Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kpa: simplify computeActiveCondition logic #14940

Closed

Conversation

andrew-delph
Copy link

@andrew-delph andrew-delph commented Feb 24, 2024

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: #14607 (comment)

@knative-prow knative-prow bot added area/API API objects and controllers area/autoscale labels Feb 24, 2024
Copy link

knative-prow bot commented Feb 24, 2024

[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 knative-prow bot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Feb 24, 2024
Copy link

knative-prow bot commented Feb 24, 2024

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.

@dprotaso
Copy link
Member

/ok-to-test

@knative-prow knative-prow bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Feb 24, 2024
Copy link

codecov bot commented Feb 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

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

❗ 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     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@andrew-delph andrew-delph force-pushed the refactor_kpa_active_status branch from df191b8 to 3c007b9 Compare February 25, 2024 16:41
@dprotaso
Copy link
Member

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

@andrew-delph andrew-delph force-pushed the refactor_kpa_active_status branch from 3c007b9 to 46c0fc7 Compare February 26, 2024 14:50
@dprotaso
Copy link
Member

dprotaso commented Mar 4, 2024

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]

@andrew-delph andrew-delph force-pushed the refactor_kpa_active_status branch 2 times, most recently from fb2440f to 7701c5a Compare March 14, 2024 18:42
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.
@andrew-delph andrew-delph force-pushed the refactor_kpa_active_status branch from 7701c5a to 351d7d9 Compare March 14, 2024 21:11
@andrew-delph
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/API API objects and controllers area/autoscale ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants