Skip to content
This repository was archived by the owner on Mar 13, 2022. It is now read-only.

Conversation

@narasux
Copy link
Contributor

@narasux narasux commented Sep 16, 2021

What type of PR is this?

/kind bug

What this PR does / why we need it:

According to fabianvf's suggestion, I try to catch the exception in the first call and safely ignore it

kubernetes-client/python#1536 (comment)

Which issue(s) this PR fixes:

Fixes kubernetes-client/python#1536

Does this PR introduce a user-facing change?

Ignore NotFoundError in the first call of LazyDiscoverer. __search

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/bug Categorizes issue or PR as related to a bug. labels Sep 16, 2021
@k8s-ci-robot
Copy link
Contributor

Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA.

It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please sign in with your organization's credentials at https://identity.linuxfoundation.org/projects/cncf to be authorized.
  • If you have done the above and are still having issues with the CLA being reported as unsigned, please log a ticket with the Linux Foundation Helpdesk: https://support.linuxfoundation.org/
  • Should you encounter any issues with the Linux Foundation Helpdesk, send a message to the backup e-mail support address at: [email protected]

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. I understand the commands that are listed here.

@k8s-ci-robot k8s-ci-robot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Sep 16, 2021
@narasux
Copy link
Contributor Author

narasux commented Sep 16, 2021

CLA signature registered

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Sep 16, 2021
@roycaihw
Copy link
Member

/assign @fabianvf


def search(self, **kwargs):
# In first call, ignore NotFoundError when raised
self.__ignore_not_found_error = True
Copy link
Contributor

Choose a reason for hiding this comment

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

It may make more sense to just put line 243 into a try... except block, as multiple calls to this method could happen concurrently in which case they could wrestle over the self.__ignore_not_found_error variable

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great suggestion, try-except is safer than use variable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

PR refreshed.

@narasux narasux force-pushed the fix_unsuitable_raise branch from 7b1f9fb to c040d87 Compare September 28, 2021 02:05
@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Sep 28, 2021
@yliaog
Copy link
Contributor

yliaog commented Oct 4, 2021

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: schneesu, yliaog

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 4, 2021
@narasux
Copy link
Contributor Author

narasux commented Oct 15, 2021

Hello @yliaog , does this PR still need to be modified? It seems that the lgtm tag is required for robot auto-merge.

image

@yliaog
Copy link
Contributor

yliaog commented Oct 15, 2021

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 15, 2021
@k8s-ci-robot k8s-ci-robot merged commit 6023e11 into kubernetes-client:master Oct 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unsuitable ResourceNotFoundError raised in LazyDiscoverer.__search, caused by cache expiration

5 participants