Merge pull request #13520 from minikube-bot/auto_bump_golint_version

bump golint version to v1.44.0
pull/13547/head
Medya Ghazizadeh 2022-02-02 15:57:24 -08:00 committed by GitHub
commit 969b5cddf1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 23 additions and 23 deletions

View File

@ -76,7 +76,7 @@ MINIKUBE_RELEASES_URL=https://github.com/kubernetes/minikube/releases/download
KERNEL_VERSION ?= 4.19.202 KERNEL_VERSION ?= 4.19.202
# latest from https://github.com/golangci/golangci-lint/releases # latest from https://github.com/golangci/golangci-lint/releases
# update this only by running `make update-golint-version` # update this only by running `make update-golint-version`
GOLINT_VERSION ?= v1.43.0 GOLINT_VERSION ?= v1.44.0
# Limit number of default jobs, to avoid the CI builds running out of memory # Limit number of default jobs, to avoid the CI builds running out of memory
GOLINT_JOBS ?= 4 GOLINT_JOBS ?= 4
# see https://github.com/golangci/golangci-lint#memory-usage-of-golangci-lint # see https://github.com/golangci/golangci-lint#memory-usage-of-golangci-lint

View File

@ -1299,7 +1299,7 @@ func validateRuntime(rtime string) error {
} }
if (rtime == "crio" || rtime == "cri-o") && (strings.HasPrefix(runtime.GOARCH, "ppc64") || detect.RuntimeArch() == "arm" || strings.HasPrefix(detect.RuntimeArch(), "arm/")) { if (rtime == "crio" || rtime == "cri-o") && (strings.HasPrefix(runtime.GOARCH, "ppc64") || detect.RuntimeArch() == "arm" || strings.HasPrefix(detect.RuntimeArch(), "arm/")) {
return errors.Errorf("The %s runtime is not compatible with the %s architecture. See https://github.com/cri-o/cri-o/issues/2467 for more details.", rtime, runtime.GOARCH) return errors.Errorf("The %s runtime is not compatible with the %s architecture. See https://github.com/cri-o/cri-o/issues/2467 for more details", rtime, runtime.GOARCH)
} }
if !validRuntime { if !validRuntime {

View File

@ -158,7 +158,7 @@ func (d *Driver) Create() error {
} else { } else {
// The conflicting container name was not created by minikube // The conflicting container name was not created by minikube
// user has a container that conflicts with minikube profile name, will not delete users container. // user has a container that conflicts with minikube profile name, will not delete users container.
return errors.Wrapf(err, "user has a conflicting container name %q with minikube container. Needs to be deleted by user's consent.", params.Name) return errors.Wrapf(err, "user has a conflicting container name %q with minikube container. Needs to be deleted by user's consent", params.Name)
} }
} }

View File

@ -58,8 +58,8 @@ func DeleteContainersByLabel(ociBin string, label string) []error {
// only try to delete if docker/podman inspect returns // only try to delete if docker/podman inspect returns
// if it doesn't it means docker daemon is stuck and needs restart // if it doesn't it means docker daemon is stuck and needs restart
if err != nil { if err != nil {
deleteErrs = append(deleteErrs, errors.Wrapf(err, "delete container %s: %s daemon is stuck. please try again!", c, ociBin)) deleteErrs = append(deleteErrs, errors.Wrapf(err, "delete container %s: %s daemon is stuck. please try again", c, ociBin))
klog.Errorf("%s daemon seems to be stuck. Please try restarting your %s. :%v", ociBin, ociBin, err) klog.Errorf("%s daemon seems to be stuck. please try restarting your %s :%v", ociBin, ociBin, err)
continue continue
} }
if err := ShutDown(ociBin, c); err != nil { if err := ShutDown(ociBin, c); err != nil {

View File

@ -46,7 +46,7 @@ func (d *Driver) getDomain() (*libvirt.Domain, *libvirt.Connect, error) {
func getConnection(connectionURI string) (*libvirt.Connect, error) { func getConnection(connectionURI string) (*libvirt.Connect, error) {
conn, err := libvirt.NewConnect(connectionURI) conn, err := libvirt.NewConnect(connectionURI)
if err != nil { if err != nil {
return nil, errors.Wrap(err, "error connecting to libvirt socket.") return nil, errors.Wrap(err, "connecting to libvirt socket")
} }
return conn, nil return conn, nil

View File

@ -168,7 +168,7 @@ func (r *Containerd) Version() (string, error) {
c := exec.Command("containerd", "--version") c := exec.Command("containerd", "--version")
rr, err := r.Runner.RunCmd(c) rr, err := r.Runner.RunCmd(c)
if err != nil { if err != nil {
return "", errors.Wrapf(err, "containerd check version.") return "", errors.Wrapf(err, "containerd check version")
} }
version, err := parseContainerdVersion(rr.Stdout.String()) version, err := parseContainerdVersion(rr.Stdout.String())
if err != nil { if err != nil {
@ -194,7 +194,7 @@ func (r *Containerd) Active() bool {
func (r *Containerd) Available() error { func (r *Containerd) Available() error {
c := exec.Command("which", "containerd") c := exec.Command("which", "containerd")
if _, err := r.Runner.RunCmd(c); err != nil { if _, err := r.Runner.RunCmd(c); err != nil {
return errors.Wrap(err, "check containerd availability.") return errors.Wrap(err, "check containerd availability")
} }
return nil return nil
} }
@ -232,7 +232,7 @@ func generateContainerdConfig(cr CommandRunner, imageRepository string, kv semve
} }
c := exec.Command("/bin/bash", "-c", fmt.Sprintf("sudo mkdir -p %s && printf %%s \"%s\" | base64 -d | sudo tee %s", path.Dir(cPath), base64.StdEncoding.EncodeToString(b.Bytes()), cPath)) c := exec.Command("/bin/bash", "-c", fmt.Sprintf("sudo mkdir -p %s && printf %%s \"%s\" | base64 -d | sudo tee %s", path.Dir(cPath), base64.StdEncoding.EncodeToString(b.Bytes()), cPath))
if _, err := cr.RunCmd(c); err != nil { if _, err := cr.RunCmd(c); err != nil {
return errors.Wrap(err, "generate containerd cfg.") return errors.Wrap(err, "generate containerd cfg")
} }
return nil return nil
} }
@ -425,7 +425,7 @@ func (r *Containerd) BuildImage(src string, file string, tag string, push bool,
c.Stdout = os.Stdout c.Stdout = os.Stdout
c.Stderr = os.Stderr c.Stderr = os.Stderr
if _, err := r.Runner.RunCmd(c); err != nil { if _, err := r.Runner.RunCmd(c); err != nil {
return errors.Wrap(err, "buildctl build.") return errors.Wrap(err, "buildctl build")
} }
return nil return nil
} }

View File

@ -59,7 +59,7 @@ func generateCRIOConfig(cr CommandRunner, imageRepository string, kv semver.Vers
c := exec.Command("/bin/bash", "-c", fmt.Sprintf("sudo sed -e 's|^pause_image = .*$|pause_image = \"%s\"|' -i %s", pauseImage, crioConfigFile)) c := exec.Command("/bin/bash", "-c", fmt.Sprintf("sudo sed -e 's|^pause_image = .*$|pause_image = \"%s\"|' -i %s", pauseImage, crioConfigFile))
if _, err := cr.RunCmd(c); err != nil { if _, err := cr.RunCmd(c); err != nil {
return errors.Wrap(err, "generateCRIOConfig.") return errors.Wrap(err, "generateCRIOConfig")
} }
if cni.Network != "" { if cni.Network != "" {
@ -97,7 +97,7 @@ func (r *CRIO) Version() (string, error) {
c := exec.Command("crio", "--version") c := exec.Command("crio", "--version")
rr, err := r.Runner.RunCmd(c) rr, err := r.Runner.RunCmd(c)
if err != nil { if err != nil {
return "", errors.Wrap(err, "crio version.") return "", errors.Wrap(err, "crio version")
} }
// crio version 1.13.0 // crio version 1.13.0
@ -118,7 +118,7 @@ func (r *CRIO) SocketPath() string {
func (r *CRIO) Available() error { func (r *CRIO) Available() error {
c := exec.Command("which", "crio") c := exec.Command("which", "crio")
if _, err := r.Runner.RunCmd(c); err != nil { if _, err := r.Runner.RunCmd(c); err != nil {
return errors.Wrapf(err, "check crio available.") return errors.Wrapf(err, "check crio available")
} }
return nil return nil
} }

View File

@ -254,7 +254,7 @@ func (r *Docker) LoadImage(path string) error {
klog.Infof("Loading image: %s", path) klog.Infof("Loading image: %s", path)
c := exec.Command("/bin/bash", "-c", fmt.Sprintf("sudo cat %s | docker load", path)) c := exec.Command("/bin/bash", "-c", fmt.Sprintf("sudo cat %s | docker load", path))
if _, err := r.Runner.RunCmd(c); err != nil { if _, err := r.Runner.RunCmd(c); err != nil {
return errors.Wrap(err, "loadimage docker.") return errors.Wrap(err, "loadimage docker")
} }
return nil return nil
} }
@ -267,7 +267,7 @@ func (r *Docker) PullImage(name string) error {
} }
c := exec.Command("docker", "pull", name) c := exec.Command("docker", "pull", name)
if _, err := r.Runner.RunCmd(c); err != nil { if _, err := r.Runner.RunCmd(c); err != nil {
return errors.Wrap(err, "pull image docker.") return errors.Wrap(err, "pull image docker")
} }
return nil return nil
} }
@ -277,7 +277,7 @@ func (r *Docker) SaveImage(name string, path string) error {
klog.Infof("Saving image %s: %s", name, path) klog.Infof("Saving image %s: %s", name, path)
c := exec.Command("/bin/bash", "-c", fmt.Sprintf("docker save '%s' | sudo tee %s >/dev/null", name, path)) c := exec.Command("/bin/bash", "-c", fmt.Sprintf("docker save '%s' | sudo tee %s >/dev/null", name, path))
if _, err := r.Runner.RunCmd(c); err != nil { if _, err := r.Runner.RunCmd(c); err != nil {
return errors.Wrap(err, "saveimage docker.") return errors.Wrap(err, "saveimage docker")
} }
return nil return nil
} }
@ -290,7 +290,7 @@ func (r *Docker) RemoveImage(name string) error {
} }
c := exec.Command("docker", "rmi", name) c := exec.Command("docker", "rmi", name)
if _, err := r.Runner.RunCmd(c); err != nil { if _, err := r.Runner.RunCmd(c); err != nil {
return errors.Wrap(err, "remove image docker.") return errors.Wrap(err, "remove image docker")
} }
return nil return nil
} }
@ -300,7 +300,7 @@ func (r *Docker) TagImage(source string, target string) error {
klog.Infof("Tagging image %s: %s", source, target) klog.Infof("Tagging image %s: %s", source, target)
c := exec.Command("docker", "tag", source, target) c := exec.Command("docker", "tag", source, target)
if _, err := r.Runner.RunCmd(c); err != nil { if _, err := r.Runner.RunCmd(c); err != nil {
return errors.Wrap(err, "tag image docker.") return errors.Wrap(err, "tag image docker")
} }
return nil return nil
} }
@ -326,14 +326,14 @@ func (r *Docker) BuildImage(src string, file string, tag string, push bool, env
c.Stdout = os.Stdout c.Stdout = os.Stdout
c.Stderr = os.Stderr c.Stderr = os.Stderr
if _, err := r.Runner.RunCmd(c); err != nil { if _, err := r.Runner.RunCmd(c); err != nil {
return errors.Wrap(err, "buildimage docker.") return errors.Wrap(err, "buildimage docker")
} }
if tag != "" && push { if tag != "" && push {
c := exec.Command("docker", "push", tag) c := exec.Command("docker", "push", tag)
c.Stdout = os.Stdout c.Stdout = os.Stdout
c.Stderr = os.Stderr c.Stderr = os.Stderr
if _, err := r.Runner.RunCmd(c); err != nil { if _, err := r.Runner.RunCmd(c); err != nil {
return errors.Wrap(err, "pushimage docker.") return errors.Wrap(err, "pushimage docker")
} }
} }
return nil return nil
@ -344,7 +344,7 @@ func (r *Docker) PushImage(name string) error {
klog.Infof("Pushing image: %s", name) klog.Infof("Pushing image: %s", name)
c := exec.Command("docker", "push", name) c := exec.Command("docker", "push", name)
if _, err := r.Runner.RunCmd(c); err != nil { if _, err := r.Runner.RunCmd(c); err != nil {
return errors.Wrap(err, "push image docker.") return errors.Wrap(err, "push image docker")
} }
return nil return nil
} }
@ -422,7 +422,7 @@ func (r *Docker) KillContainers(ids []string) error {
args := append([]string{"rm", "-f"}, ids...) args := append([]string{"rm", "-f"}, ids...)
c := exec.Command("docker", args...) c := exec.Command("docker", args...)
if _, err := r.Runner.RunCmd(c); err != nil { if _, err := r.Runner.RunCmd(c); err != nil {
return errors.Wrap(err, "Killing containers docker.") return errors.Wrap(err, "killing containers docker")
} }
return nil return nil
} }

View File

@ -59,7 +59,7 @@ func fixHost(api libmachine.API, cc *config.ClusterConfig, n *config.Node) (*hos
h, err := api.Load(config.MachineName(*cc, *n)) h, err := api.Load(config.MachineName(*cc, *n))
if err != nil { if err != nil {
return h, errors.Wrap(err, "Error loading existing host. Please try running [minikube delete], then run [minikube start] again.") return h, errors.Wrap(err, "error loading existing host. Please try running [minikube delete], then run [minikube start] again")
} }
defer postStartValidations(h, cc.Driver) defer postStartValidations(h, cc.Driver)