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

Skip non modified event first while waiting for ready #1390

Merged

Conversation

cardil
Copy link
Contributor

@cardil cardil commented Jul 19, 2021

Description

Allow using wait for ready with dynamic kube client, as before this change, an error was received on Added event with unstructured object, which by default doesn't have .status field.

Changes

Reference

Fixes #1389

Copy link
Contributor

@knative-prow-robot knative-prow-robot left a comment

Choose a reason for hiding this comment

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

@cardil: 0 warnings.

In response to this:

Description

Allow using wait for ready with dynamic kube client, as before this change, an error was received on Added event with unstructured object, which by default doesn't have .status field.

Changes

Reference

Fixes #1389

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.

@google-cla google-cla bot added the cla: yes Indicates the PR's author has signed the CLA. label Jul 19, 2021
@knative-prow-robot knative-prow-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jul 19, 2021
@codecov
Copy link

codecov bot commented Jul 19, 2021

Codecov Report

Merging #1390 (6479023) into main (e26d5f2) will increase coverage by 1.68%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1390      +/-   ##
==========================================
+ Coverage   76.51%   78.20%   +1.68%     
==========================================
  Files         160      160              
  Lines        8234     8234              
==========================================
+ Hits         6300     6439     +139     
+ Misses       1229     1104     -125     
+ Partials      705      691      -14     
Impacted Files Coverage Δ
pkg/wait/test_wait_helper.go 100.00% <100.00%> (ø)
pkg/wait/wait_for_ready.go 87.71% <100.00%> (+5.26%) ⬆️
pkg/serving/config_changes.go 84.74% <0.00%> (+6.77%) ⬆️
pkg/serving/v1/gitops.go 85.22% <0.00%> (+11.36%) ⬆️
pkg/serving/v1/apply.go 80.32% <0.00%> (+11.47%) ⬆️
pkg/kn/commands/namespaced.go 81.08% <0.00%> (+16.21%) ⬆️
pkg/serving/v1/client.go 81.86% <0.00%> (+19.06%) ⬆️
pkg/kn/commands/describe.go 89.69% <0.00%> (+20.61%) ⬆️
pkg/kn/commands/types.go 80.23% <0.00%> (+26.74%) ⬆️
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e26d5f2...6479023. Read the comment docs.

cardil added a commit to cardil/kn-plugin-event that referenced this pull request Jul 19, 2021
cardil added a commit to cardil/kn-plugin-event that referenced this pull request Jul 19, 2021
Copy link
Contributor

@maximilien maximilien left a comment

Choose a reason for hiding this comment

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

/ok-to-test

pkg/wait/wait_for_ready_test.go Outdated Show resolved Hide resolved
@knative-prow-robot knative-prow-robot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label Jul 19, 2021
@itsmurugappan
Copy link
Contributor

lgtm, but to pass the code cov test, the lines that were changed need to have more than 76.51 % coverage.

@dsimansk
Copy link
Contributor

lgtm, but to pass the code cov test, the lines that were changed need to have more than 76.51 % coverage.

@cardil can you please take a look at the coverage? We've discussed on WG call that if it's too cumbersome to reach some of the statements it can be even merged without reaching the required number, just let us know please. :)

Comment on lines +325 to +326
func peUnstructured(tb testing.TB) func(name string) ([]watch.Event, int) {
return func(name string) ([]watch.Event, int) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Neat! :)

@knative-prow-robot knative-prow-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jul 21, 2021
@knative-metrics-robot
Copy link

The following is the coverage report on the affected files.
Say /test pull-knative-client-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/wait/wait_for_ready.go 90.0% 93.0% 3.0

@cardil
Copy link
Contributor Author

cardil commented Jul 21, 2021

@itsmurugappan @dsimansk I did raise the coverage on reported method, although it's a synthetic example that shouldn't occur with duck elements, which always should have generation and observed generation. Now, this PR passes all the gates.

@cardil cardil requested a review from dsimansk July 21, 2021 17:02
@cardil
Copy link
Contributor Author

cardil commented Jul 21, 2021

/cc @itsmurugappan

Copy link
Contributor

@itsmurugappan itsmurugappan left a comment

Choose a reason for hiding this comment

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

/lgtm

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 21, 2021
@itsmurugappan
Copy link
Contributor

cool, coverage also jumping by 1.68% 👍

@cardil cardil requested a review from maximilien July 21, 2021 17:10
@dsimansk
Copy link
Contributor

/lgtm

@dsimansk
Copy link
Contributor

Since it's addressing all the review comments, imo it's good to go.
/approve

@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cardil, dsimansk, itsmurugappan

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

The pull request process is described 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-robot knative-prow-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 21, 2021
@knative-prow-robot knative-prow-robot merged commit a7df7c7 into knative:main Jul 21, 2021
@cardil cardil deleted the bugfix/1389-skip-non-modified-first branch July 21, 2021 19:23
knative-prow-robot pushed a commit to knative-extensions/kn-plugin-event that referenced this pull request Jul 22, 2021
* Fixing the addressable resolver

* Properly working address resolver

* Working fake & it tests (apart those affected by knative/client#1389)

* Upgrade to latest knative

* Use interim fork until merge of knative/client#1390

* Allow addressable URI to be empty, and by default

* Remove interim personal fork
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cla: yes Indicates the PR's author has signed the CLA. lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

WaitForReady should check for event type before trying to read generation number
6 participants