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
Contributor

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

This comment has been minimized.

Copy link
Contributor

commented Aug 13, 2019

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.

@fisherxu

This comment has been minimized.

Copy link
Member

commented Aug 13, 2019

/ok-to-test

@RainbowMango RainbowMango force-pushed the RainbowMango:pr_fix_golint_for_discovery_fake branch from 39cdb1b to c3afd7c Aug 13, 2019

@RainbowMango

This comment has been minimized.

Copy link
Contributor Author

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 and removed size/M labels Aug 14, 2019

@k8s-ci-robot

This comment has been minimized.

Copy link
Contributor

commented Aug 14, 2019

[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

This comment has been minimized.

Copy link
Contributor Author

commented Aug 15, 2019

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 {

This comment has been minimized.

Copy link
@sttts

sttts Aug 15, 2019

Contributor

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

This comment has been minimized.

Copy link
@RainbowMango

RainbowMango Aug 15, 2019

Author Contributor

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
You can’t perform that action at this time.