Kubeadm: Switch to github.com/pkg/errors

Created on 23 Oct 2018  Â·  9Comments  Â·  Source: kubernetes/kubeadm

Currently kubeadm code base uses fmt.Errorf both for wrapping errors and for creating new errors, but there is a general consensus on moving toward github.com/pkg/errors

e.g.

// wrapping errors
// from
fmt.Errorf("couldn't create a temporary directory: %v", err)
// to
errors.Wrap(err, "couldn't create a temporary directory")

// creating new errors
// from
fmt.Errorf("couldn't initialize a Kubernetes cluster")
// to
errors. New("couldn't initialize a Kubernetes cluster")

@timothysc @rosti @neolit123 @chuckha @detiber @liztio
If there is consensus, this is a good issue for new contributors that can do this package by packages (or grouping packages)

good first issue help wanted kincleanup lifecyclactive prioritimportant-longterm

All 9 comments

If there is consensus on this issue , I would like to work on it
I prefer to use errors.Wrap() and errors.New()

@yuexiao-wang hi, we should use errors.Wrap() and errors.New().

thanks a lot for the help.
/lifecycle active

@neolit123 thanks, i am ready to go

I've started picking off a few packages for this (see kubernetes/kubernetes#70272).

@joshuarubin You maybe do some repeated work? I have modify almost packages for this issue.
Please check your PR.

folks please observe if a help-wanted issue has a /lifecycle active label, which means that someone is already working on it. e.g. https://github.com/kubernetes/kubeadm/issues/1183#issuecomment-432219437

Ah! Sorry about that! I'm new to the project and wasn't familiar with what /lifecycle active meant. Feel free to take any of my work if there's anything you haven't yet done. I'll stand down on this.

@yuexiao-wang I add other packages in /kubeadm/app/ as follows:
cmd/kubeadm/app/constants
cmd/kubeadm/app/features
cmd/kubeadm/app/preflight

ok.
the rest of kubeadm packeages will be amended into my PR https://github.com/kubernetes/kubernetes/pull/70271

Was this page helpful?
0 / 5 - 0 ratings