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

Fix informer-gen to honor nonNamespaced tag #80458

Merged
merged 2 commits into from
Sep 27, 2019

Conversation

tatsuhiro-t
Copy link
Contributor

What type of PR is this?

Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespaces from that line:

/kind api-change

/kind bug

/kind cleanup
/kind design
/kind documentation
/kind failing-test
/kind feature
/kind flake

What this PR does / why we need it:

This PR fixes #80457 so that informer-gen produces correct code for a type with nonNamespaced tag.

Which issue(s) this PR fixes:

Fixes #80457

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

Fixes the bug in informer-gen that it produces incorrect code if a type has nonNamespaced tag set.

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@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. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Jul 23, 2019
@k8s-ci-robot
Copy link
Contributor

Hi @tatsuhiro-t. Thanks for your PR.

I'm waiting for a kubernetes 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.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. area/code-generation sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Jul 23, 2019
@roycaihw
Copy link
Member

/cc @yliaog

@k8s-ci-robot k8s-ci-robot requested a review from yliaog July 25, 2019 20:06
@yliaog
Copy link
Contributor

yliaog commented Jul 25, 2019

please add a test case for this fix

@tatsuhiro-t
Copy link
Contributor Author

Where is the existing test case?

@yliaog
Copy link
Contributor

yliaog commented Jul 27, 2019

it looks there is not one currently. but still it is good to add one.

@tatsuhiro-t
Copy link
Contributor Author

I have no time to add test case from scratch. I think it is much better and beneficial to everyone to merge this simple fix rather than leaving code-generator in miserable, unusable state.

@yliaog
Copy link
Contributor

yliaog commented Jul 29, 2019

please see my comment in #80457, i think the current informer gen is working as intended.

@tatsuhiro-t
Copy link
Contributor Author

I disagree. The other generators can handle this without extra blank lines. Actually, informer-gen partially handles this except for the broken portion which #80458 tries to fix.
Leaving generator tool like this in inconsistent state is huge UX regression. This is clearly a bug to me.

@yliaog
Copy link
Contributor

yliaog commented Jul 30, 2019

ok, i agree with you. could you maybe modify the test in the following directories to make sure it won't regress.

staging/src/k8s.io/code-generator/hack/verify-codegen.sh
staging/src/k8s.io/code-generator/_examples/apiserver/informers/

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jul 30, 2019
@tatsuhiro-t
Copy link
Contributor Author

904dc3e62e0628fa49249779687cdf730c9ac4c0 modifies test to exercise nonNamespaced tag

@yliaog
Copy link
Contributor

yliaog commented Jul 30, 2019

/lgtm

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 31, 2019
@yliaog
Copy link
Contributor

yliaog commented Jul 31, 2019

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 31, 2019
@trierra
Copy link
Contributor

trierra commented Aug 16, 2019

what else is required for this PR to be merged? Maybe I can help?

@yliaog
Copy link
Contributor

yliaog commented Aug 16, 2019

it needs approval.
@sttts could you please take a look?

@tatsuhiro-t
Copy link
Contributor Author

Is there any blocking issue to approve this PR?

@tatsuhiro-t
Copy link
Contributor Author

@yliaog @sttts 1 month passed since I got LGTM from @yliaog
Any chance to approve this PR?

@tatsuhiro-t
Copy link
Contributor Author

@sttts @lavalamp @yliaog ping

@nikhita
Copy link
Member

nikhita commented Sep 24, 2019

super tiny nit: can you squash the last two commits together?

/assign @sttts
for approval

@nikhita
Copy link
Member

nikhita commented Sep 24, 2019

/priority important-soon

@k8s-ci-robot k8s-ci-robot added priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. and removed needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Sep 24, 2019
@nikhita
Copy link
Member

nikhita commented Sep 24, 2019

/milestone v1.17

@k8s-ci-robot k8s-ci-robot added this to the v1.17 milestone Sep 24, 2019
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 25, 2019
@tatsuhiro-t
Copy link
Contributor Author

@nikhita Squashed 2 last commits into one and force-pushed. Thank you.

Copy link
Member

@nikhita nikhita left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 25, 2019
@nikhita
Copy link
Member

nikhita commented Sep 25, 2019

node-e2e is currently broken: #83086

@nikhita
Copy link
Member

nikhita commented Sep 25, 2019

/retest

@sttts
Copy link
Contributor

sttts commented Sep 26, 2019

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sttts, tatsuhiro-t

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 Sep 26, 2019
@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@tatsuhiro-t
Copy link
Contributor Author

/retest

@k8s-ci-robot k8s-ci-robot merged commit 2b4dc31 into kubernetes:master Sep 27, 2019
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. area/code-generation 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 "Looks good to me", 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. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. 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.

Could not compile generated informer with +genclient:nonNamespaced
8 participants