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 staticcheck failures #90208

Open
dims opened this issue Apr 16, 2020 · 7 comments
Open

Fix staticcheck failures #90208

dims opened this issue Apr 16, 2020 · 7 comments

Comments

@dims
Copy link
Member

@dims dims commented Apr 16, 2020

from: https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/90183/pull-kubernetes-verify/1250761092716564483

Errors from staticcheck:
cmd/kubeadm/app/preflight/checks.go:806:12: possible nil pointer dereference (SA5011)
cmd/kubeadm/app/preflight/checks.go:808:7: this check suggests that the pointer can be nil
cmd/kubeadm/app/util/config/cluster_test.go:752:11: possible nil pointer dereference (SA5011)
cmd/kubeadm/app/util/config/cluster_test.go:749:7: this check suggests that the pointer can be nil
pkg/kubelet/stats/cri_stats_provider.go:705:32: possible nil pointer dereference (SA5011)
pkg/kubelet/stats/cri_stats_provider.go:701:6: this check suggests that the pointer can be nil
pkg/util/ipvs/ipvs_linux_test.go:184:20: the address of a variable cannot be nil (SA4022)
pkg/volume/awsebs/aws_ebs_block_test.go:81:5: the address of a variable cannot be nil (SA4022)
pkg/volume/azure_dd/azure_dd_block_test.go:70:5: the address of a variable cannot be nil (SA4022)
pkg/volume/cinder/cinder_block_test.go:73:5: the address of a variable cannot be nil (SA4022)
pkg/volume/gcepd/gce_pd_block_test.go:73:5: the address of a variable cannot be nil (SA4022)
pkg/volume/gcepd/gce_pd_test.go:226:17: possible nil pointer dereference (SA5011)
pkg/volume/gcepd/gce_pd_test.go:223:5: this check suggests that the pointer can be nil
pkg/volume/gcepd/gce_pd_test.go:227:26: possible nil pointer dereference (SA5011)
pkg/volume/gcepd/gce_pd_test.go:223:5: this check suggests that the pointer can be nil
pkg/volume/rbd/rbd_test.go:89:5: the address of a variable cannot be nil (SA4022)
pkg/volume/testing/testing.go:403:16: possible nil pointer dereference (SA5011)
pkg/volume/testing/testing.go:404:5: this check suggests that the pointer can be nil
pkg/volume/vsphere_volume/vsphere_volume_block_test.go:72:5: the address of a variable cannot be nil (SA4022)
test/e2e/scheduling/predicates.go:1055:46: possible nil pointer dereference (SA5011)
test/e2e/scheduling/predicates.go:1054:27: this check suggests that the pointer can be nil
test/e2e/scheduling/predicates.go:1060:46: possible nil pointer dereference (SA5011)
test/e2e/scheduling/predicates.go:1059:27: this check suggests that the pointer can be nil
test/e2e/scheduling/predicates.go:1061:27: possible nil pointer dereference (SA5011)
test/e2e/scheduling/predicates.go:1059:27: this check suggests that the pointer can be nil
test/e2e_node/gke_environment_test.go:306:6: func checkDockerStorageDriver is unused (U1000)
vendor/k8s.io/client-go/plugin/pkg/client/auth/azure/azure_test.go:124:24: possible nil pointer dereference (SA5011)
vendor/k8s.io/client-go/plugin/pkg/client/auth/azure/azure_test.go:121:7: this check suggests that the pointer can be nil
vendor/k8s.io/client-go/plugin/pkg/client/auth/azure/azure_test.go:128:10: possible nil pointer dereference (SA5011)
vendor/k8s.io/client-go/plugin/pkg/client/auth/azure/azure_test.go:125:7: this check suggests that the pointer can be nil
vendor/k8s.io/client-go/util/cert/csr_test.go:57:14: possible nil pointer dereference (SA5011)
vendor/k8s.io/client-go/util/cert/csr_test.go:51:5: this check suggests that the pointer can be nil
vendor/k8s.io/client-go/util/certificate/certificate_store_test.go:319:14: possible nil pointer dereference (SA5011)
vendor/k8s.io/client-go/util/certificate/certificate_store_test.go:316:5: this check suggests that the pointer can be nil
vendor/k8s.io/legacy-cloud-providers/azure/azure_test.go:1733:14: possible nil pointer dereference (SA5011)
vendor/k8s.io/legacy-cloud-providers/azure/azure_test.go:1729:5: this check suggests that the pointer can be nil

/good-first-issue

@dims dims added the kind/bug label Apr 16, 2020
@k8s-ci-robot
Copy link
Contributor

@k8s-ci-robot k8s-ci-robot commented Apr 16, 2020

@dims:
This request has been marked as suitable for new contributors.

Please ensure the request meets the requirements listed here.

If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-good-first-issue command.

In response to this:

from: https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/90183/pull-kubernetes-verify/1250761092716564483

Errors from staticcheck:
cmd/kubeadm/app/preflight/checks.go:806:12: possible nil pointer dereference (SA5011)
cmd/kubeadm/app/preflight/checks.go:808:7: this check suggests that the pointer can be nil
cmd/kubeadm/app/util/config/cluster_test.go:752:11: possible nil pointer dereference (SA5011)
cmd/kubeadm/app/util/config/cluster_test.go:749:7: this check suggests that the pointer can be nil
pkg/kubelet/stats/cri_stats_provider.go:705:32: possible nil pointer dereference (SA5011)
pkg/kubelet/stats/cri_stats_provider.go:701:6: this check suggests that the pointer can be nil
pkg/util/ipvs/ipvs_linux_test.go:184:20: the address of a variable cannot be nil (SA4022)
pkg/volume/awsebs/aws_ebs_block_test.go:81:5: the address of a variable cannot be nil (SA4022)
pkg/volume/azure_dd/azure_dd_block_test.go:70:5: the address of a variable cannot be nil (SA4022)
pkg/volume/cinder/cinder_block_test.go:73:5: the address of a variable cannot be nil (SA4022)
pkg/volume/gcepd/gce_pd_block_test.go:73:5: the address of a variable cannot be nil (SA4022)
pkg/volume/gcepd/gce_pd_test.go:226:17: possible nil pointer dereference (SA5011)
pkg/volume/gcepd/gce_pd_test.go:223:5: this check suggests that the pointer can be nil
pkg/volume/gcepd/gce_pd_test.go:227:26: possible nil pointer dereference (SA5011)
pkg/volume/gcepd/gce_pd_test.go:223:5: this check suggests that the pointer can be nil
pkg/volume/rbd/rbd_test.go:89:5: the address of a variable cannot be nil (SA4022)
pkg/volume/testing/testing.go:403:16: possible nil pointer dereference (SA5011)
pkg/volume/testing/testing.go:404:5: this check suggests that the pointer can be nil
pkg/volume/vsphere_volume/vsphere_volume_block_test.go:72:5: the address of a variable cannot be nil (SA4022)
test/e2e/scheduling/predicates.go:1055:46: possible nil pointer dereference (SA5011)
test/e2e/scheduling/predicates.go:1054:27: this check suggests that the pointer can be nil
test/e2e/scheduling/predicates.go:1060:46: possible nil pointer dereference (SA5011)
test/e2e/scheduling/predicates.go:1059:27: this check suggests that the pointer can be nil
test/e2e/scheduling/predicates.go:1061:27: possible nil pointer dereference (SA5011)
test/e2e/scheduling/predicates.go:1059:27: this check suggests that the pointer can be nil
test/e2e_node/gke_environment_test.go:306:6: func checkDockerStorageDriver is unused (U1000)
vendor/k8s.io/client-go/plugin/pkg/client/auth/azure/azure_test.go:124:24: possible nil pointer dereference (SA5011)
vendor/k8s.io/client-go/plugin/pkg/client/auth/azure/azure_test.go:121:7: this check suggests that the pointer can be nil
vendor/k8s.io/client-go/plugin/pkg/client/auth/azure/azure_test.go:128:10: possible nil pointer dereference (SA5011)
vendor/k8s.io/client-go/plugin/pkg/client/auth/azure/azure_test.go:125:7: this check suggests that the pointer can be nil
vendor/k8s.io/client-go/util/cert/csr_test.go:57:14: possible nil pointer dereference (SA5011)
vendor/k8s.io/client-go/util/cert/csr_test.go:51:5: this check suggests that the pointer can be nil
vendor/k8s.io/client-go/util/certificate/certificate_store_test.go:319:14: possible nil pointer dereference (SA5011)
vendor/k8s.io/client-go/util/certificate/certificate_store_test.go:316:5: this check suggests that the pointer can be nil
vendor/k8s.io/legacy-cloud-providers/azure/azure_test.go:1733:14: possible nil pointer dereference (SA5011)
vendor/k8s.io/legacy-cloud-providers/azure/azure_test.go:1729:5: this check suggests that the pointer can be nil

/good-first-issue

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.

@athenabot
Copy link

@athenabot athenabot commented Apr 16, 2020

/sig cloud-provider

These SIGs are my best guesses for this issue. Please comment /remove-sig <name> if I am incorrect about one.

🤖 I am a bot run by vllry. 👩‍🔬

@gavinfish
Copy link
Member

@gavinfish gavinfish commented Apr 16, 2020

Duplicated with #81657 🤔 ?

@Sudhar287
Copy link

@Sudhar287 Sudhar287 commented Apr 17, 2020

Can I please work on this issue? :)

@tangcong
Copy link
Contributor

@tangcong tangcong commented Apr 17, 2020

/assign

@tangcong
Copy link
Contributor

@tangcong tangcong commented Apr 19, 2020

@dims i have submitted pr #90275 to fix this issue. PTAL. thanks.

@bala83
Copy link

@bala83 bala83 commented May 17, 2020

Is this issue is fixed ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
7 participants
You can’t perform that action at this time.