kubernetes: Stop using github.com/pkg/errors

We should be using Go native error wrapping (available since Go 1.13) (similar to what was done in https://github.com/containerd/console/pull/54)

NOTE : Please do not submit PRs for cmd/kubeadm/app though it is listed below.

code search : https://cs.k8s.io/?q="github.com%2Fpkg%2Ferrors"&i=nope&files=&excludeFiles=vendor%2F&repos=kubernetes/kubernetes ripgrep search :

[dims@dims-a01 06:29] ~/go/src/k8s.io/kubernetes ⟩ rg '"github.com/pkg/errors"' | grep -v vendor/ | cut -f 1 -d ':' | cut -d '/' -f 1-3 | sort | uniq -c | sort
   1 cmd/kube-proxy/app
   1 cmd/kubeadm/test
   1 hack/conformance/check_conformance_test_requirements.go
   1 pkg/kubelet/pluginmanager
   1 pkg/kubelet/server
   1 pkg/util/ipvs
   1 pkg/util/netsh
   1 test/utils/deployment.go
   1 test/utils/pki_helpers.go
   2 pkg/kubelet/kubeletconfig
   2 staging/src/k8s.io
   2 test/e2e/windows
   3 cluster/images/conformance
   3 test/e2e/framework
   3 test/e2e/network
   4 test/e2e/storage
 120 cmd/kubeadm/app

If folks can pick up one line each and submit a PR, that would help get this turned around quickly. thanks!

BONUS: if someone can reuse one of the existing verify scripts under hack to ensure we don’t regress, that would be awesome!

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 5
  • Comments: 44 (35 by maintainers)

Most upvoted comments

@mcbenjemaa since you have contributed to k8s before and are in the github org, may be you can tackle the BONUS one? leave the easy stuff to new folks?

Taking up files :

   1 pkg/kubelet/server
   1 pkg/util/ipvs
   1 pkg/util/netsh

@gdsoumya Hi, please don’t mix and match files between SIGs if possible. If you want to do node files, do

   1 pkg/kubelet/pluginmanager
   1 pkg/kubelet/server
   2 pkg/kubelet/kubeletconfig

If you want to do network, do

   1 cmd/kube-proxy/app
   1 pkg/util/ipvs
   1 pkg/util/netsh
   3 test/e2e/network

I will be closing PRs to SIG Node that only touch one or two files and split reviews between PRs. Just do them all in one go.

Makes sense to cleanup sparse usage across the code base. But usage in kubeadm is intentional and %w is just not the same. We rather not touch kubeadm for the time being.