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 golint error for staging/src/k8s.io/client-go/discovery/fake #81352

Conversation

RainbowMango
Copy link
Member

@RainbowMango RainbowMango commented Aug 13, 2019

What type of PR is this?
/kind cleanup

What this PR does / why we need it:
Fix golint errors from staging/src/k8s.io/client-go/discovery/fake and remove the directory from hack/.golint_failures.

Which issue(s) this PR fixes:

Special notes for your reviewer:
Errors from golint:

staging/src/k8s.io/client-go/discovery/fake/discovery.go:34:6: type name will be used as fake.FakeDiscovery by other packages, and that stutters; consider calling this Discovery

Does this PR introduce a user-facing change?:

NONE

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

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. 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 Aug 13, 2019
@k8s-ci-robot
Copy link
Contributor

Hi @RainbowMango. 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 the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Aug 13, 2019
@k8s-ci-robot k8s-ci-robot added area/code-generation area/kubeadm sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Aug 13, 2019
@fisherxu
Copy link
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot 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 Aug 13, 2019
@RainbowMango RainbowMango force-pushed the pr_fix_golint_for_discovery_fake branch from 39cdb1b to c3afd7c Compare August 13, 2019 12:55
@RainbowMango
Copy link
Member Author

RainbowMango commented Aug 14, 2019

It's my first time to deal with generated files.
I tried running make update, but the error happens when update docs.

Running update-generated-docs
k8s.io/kubernetes/vendor/k8s.io/client-go/kubernetes/fake
vendor/k8s.io/client-go/kubernetes/fake/clientset_generated.go:137:13: undefined: >"k8s.io/kubernetes/vendor/k8s.io/client-go/discovery/fake".FakeDiscovery
!!! [0814 10:24:43] Call tree:
!!! [0814 10:24:43] 1: /root/go/src/k8s.io/kubernetes/hack/lib/golang.sh:714 kube::golang::build_some_binaries(...)
!!! [0814 10:24:43] 2: /root/go/src/k8s.io/kubernetes/hack/lib/golang.sh:853 kube::golang::build_binaries_for_platform(...)
!!! [0814 10:24:43] 3: hack/make-rules/build.sh:27 kube::golang::build_binaries(...)
!!! [0814 10:24:43] Call tree:
!!! [0814 10:24:43] 1: hack/make-rules/build.sh:27 kube::golang::build_binaries(...)
!!! [0814 10:24:43] Call tree:
!!! [0814 10:24:43] 1: hack/make-rules/build.sh:27 kube::golang::build_binaries(...)
make[1]: *** [all] Error 1
Running update-generated-docs FAILED
make: *** [update] Error 1

@k8s-ci-robot k8s-ci-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 Aug 14, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: RainbowMango
To complete the pull request process, please assign lavalamp
You can assign the PR to them by writing /assign @lavalamp in a comment when ready.

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

@RainbowMango
Copy link
Member Author

Seems fake. Let's test again.
W0814 12:39:22.231] Server terminated abruptly (error code: 14, error message: '', log file: '/bazel-scratch/.cache/bazel/_bazel_prow/48d5366022b4e3197674c8d6e2bee219/server/jvm.out')

/retest

// but doesn't respect the return value if any. There is a way to fake static values like ServerVersion by using the Faked... fields on the struct.
type FakeDiscovery struct {
type Discovery struct {
Copy link
Contributor

Choose a reason for hiding this comment

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

we cannot change this. It breaks tons of 3rdparty code.

Copy link
Member Author

Choose a reason for hiding this comment

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

OK, thanks. I will close this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/code-generation area/kubeadm cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note-none Denotes a PR that doesn't merit a release note. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. 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.

4 participants