kubernetes: Fix static check failures

As #81189 has been merged, there are a lot of packages that cannot pass the static check and we need to clean them up!

Step 1: Remove one or two packages (related packages) from the list in - https://github.com/kubernetes/kubernetes/blame/master/hack/.staticcheck_failures Step 2: Run hack/verify-staticcheck.sh and look at the logged errors Step 3: Fix the code to ensure that hack/verify-staticcheck.sh runs cleanly. Step 4: Run hack/update-bazel.sh and hack/update-gofmt.sh to make sure we fix any problems with gofmt or bazel. Step 5: File a PR with the change

  • please append the packages you picked at the end.

  • For existing contributor, please make sure this list is update to date

  • Don’t use Fixes: #81657 which will shut down the issue, just use Ref:#81657

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 80 (74 by maintainers)

Most upvoted comments

@beautytiger

if you change codes in the staging directory , you can run the following commend to make sure the symbol link is alway avaliable.

hack/update-vendor.sh

if you change api or apis package, you should regenerate code and docs.

hack/update-codegen.sh
hack/update-generated-docs.sh

@RainbowMango thanks for your time, I will take up:

plugin/pkg/admission/*
test/instrumentation
hack/make-rules/helpers/go2make/testdata/dir-with-gofiles

Let us know,when creating a new pr, the description of the pr should not be: Fixes #81657, which will shut down the issue (I think it’s a long-term effort); it should be ref #81657.

Update remaining tasks:

vendor/k8s.io/api/events/v1beta1
vendor/k8s.io/cli-runtime/pkg/resource
vendor/k8s.io/cloud-provider/service/helpers
vendor/k8s.io/legacy-cloud-providers/azure
vendor/k8s.io/sample-controller

I’ll pick up:

pkg/registry/autoscaling/horizontalpodautoscaler/storage
pkg/registry/core/namespace/storage
pkg/registry/core/persistentvolumeclaim/storage
pkg/registry/core/resourcequota/storage
pkg/registry/core/service/ipallocator
pkg/registry/core/service/portallocator
pkg/registry/core/service/storage
pkg/registry/extensions/controller/storage

=> #81742

As well as:

pkg/scheduler
pkg/scheduler/algorithm/predicates
pkg/scheduler/algorithm/priorities
pkg/scheduler/api/v1
pkg/scheduler/apis/config/v1alpha1
pkg/scheduler/internal/queue
cmd/kube-scheduler
pkg/apis/scheduling/v1alpha1
pkg/apis/scheduling/v1beta1
pkg/controller/volume/scheduling
test/e2e/scheduling
test/integration/scheduler
test/integration/scheduler_perf
test/integration/volumescheduling

=> #81744

FYI.

Packages in pkg/kubelet/* aready in #81206.

I will pick these up 😃

test/e2e/framework
test/e2e/framework/ingress
test/e2e/framework/kubelet
test/e2e/framework/node
test/e2e/framework/pod
test/e2e/framework/podlogs
test/e2e/framework/providers/aws
test/e2e/framework/providers/gce
test/e2e/framework/psp
test/e2e/framework/service
test/e2e/framework/volume

Following packages, vendor/k8s.io/apiserver/* has been reserved:

vendor/k8s.io/apiserver/pkg/admission/initializer
vendor/k8s.io/apiserver/pkg/authentication/request/x509
...
vendor/k8s.io/apiserver/plugin/pkg/authenticator/token/webhook
vendor/k8s.io/apiserver/plugin/pkg/authorizer/webhook

[edit] Reserve all apiserver area files because they have similar issues and sometimes may be fixed together.

vendor/k8s.io/api/events/v1beta1
vendor/k8s.io/apiextensions-apiserver/pkg/apiserver
...
vendor/k8s.io/apiextensions-apiserver/test/integration/fixtures
vendor/k8s.io/apimachinery/pkg/api/meta
...
vendor/k8s.io/apimachinery/pkg/util/wait
vendor/k8s.io/client-go/discovery/cached/memory
...
vendor/k8s.io/client-go/util/jsonpath

Following packages has been reserved:

-vendor/k8s.io/code-generator/cmd/client-gen/generators/fake
-vendor/k8s.io/code-generator/cmd/client-gen/generators/util
-vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf

/assign

@hpandeycodeit yes, i am also trying to put together few PR from /pkg/controller - bottom to top in the list. Will try to pick up few more later. Would be happy to help.