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

protokube/pkg - fix static check #8165

Merged
merged 1 commit into from
Dec 23, 2019

Conversation

hakman
Copy link
Member

@hakman hakman commented Dec 20, 2019

Ref: #7800

Errors from staticcheck:

protokube/pkg/gossip/dns/hosts/hosts.go:162:6: func atomicWriteFile is unused (U1000)
protokube/pkg/gossip/mesh/gossip.go:43:2: field version is unused (U1000)
protokube/pkg/gossip/mesh/mesh.pb.go:173:6: func encodeFixed64Mesh is unused (U1000)
protokube/pkg/gossip/mesh/mesh.pb.go:184:6: func encodeFixed32Mesh is unused (U1000)
protokube/pkg/gossip/mesh/mesh.pb.go:244:6: func sozMesh is unused (U1000)
protokube/pkg/gossip/mesh/mesh.pb.go:279:6: func valueToStringMesh is unused (U1000)
protokube/pkg/protokube/etcd_cluster.go:99:2: field volume is unused (U1000)
protokube/pkg/protokube/etcd_cluster.go:100:2: field volumeSpec is unused (U1000)

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Dec 20, 2019
@k8s-ci-robot
Copy link
Contributor

Hi @hakman. 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 size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Dec 20, 2019
@hakman
Copy link
Member Author

hakman commented Dec 20, 2019

/cc @rifelpet
/cc @tanjunchen

Copy link
Member

@tanjunchen tanjunchen left a comment

Choose a reason for hiding this comment

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

@hakman Thanks for cc

mustRemove = false
return nil
}
//func atomicWriteFile(filename string, data []byte, perm os.FileMode) error {
Copy link
Member

Choose a reason for hiding this comment

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

atomicWriteFile can remove not comment?

Copy link
Member Author

Choose a reason for hiding this comment

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

Looked like someone did some work to create it. Maybe someone needs it for something at some point in time.

Copy link
Member

Choose a reason for hiding this comment

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

sure i get it

Copy link
Member Author

Choose a reason for hiding this comment

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

Decided you were right. It's Git, anyone can go back to a version that had the function and copy it.

upup/pkg/fi/cloudup/alitasks/securitygrouprule.go Outdated Show resolved Hide resolved
@tanjunchen
Copy link
Member

/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 Dec 20, 2019
@hakman
Copy link
Member Author

hakman commented Dec 20, 2019

/test pull-kops-e2e-kubernetes-aws

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Dec 20, 2019
@@ -170,6 +170,7 @@ func (m *KVStateRecord) MarshalTo(data []byte) (int, error) {
return i, nil
}

//lint:ignore U1000 - Generated by protoc-gen-gogo from mesh.proto
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure we can add comments to this file, wont they get wiped the next time we regenerate the file? Maybe theres a setting in the generation that we can add, or maybe we'll need to permanently exclude this file from staticcheck. It might be possible to configure the generator to add a single file exclusion comment

Copy link
Member Author

Choose a reason for hiding this comment

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

Nice catch with the file exclusion.
The file has been generated almost 3 years ago and there are already some comments like the copyright. If it's ever regenerated, the static check should catch this again.

@hakman
Copy link
Member Author

hakman commented Dec 23, 2019

/test pull-kops-verify-staticcheck

@hakman hakman requested a review from rifelpet December 23, 2019 09:54
@hakman
Copy link
Member Author

hakman commented Dec 23, 2019

/assign @chrisz100

@chrisz100
Copy link
Contributor

/lgtm
/approve

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: chrisz100, hakman

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 Dec 23, 2019
@k8s-ci-robot k8s-ci-robot merged commit 5f588f0 into kubernetes:master Dec 23, 2019
@hakman hakman deleted the staticcheck-protokube branch December 27, 2019 20:57
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. 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. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants