From 7ba402742a016cc6f10951492b0bdaf7029feae3 Mon Sep 17 00:00:00 2001 From: minikube-bot Date: Mon, 31 Jan 2022 10:01:44 +0000 Subject: [PATCH 1/3] bump golint versions --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 32a583db2a..326a39a6a9 100644 --- a/Makefile +++ b/Makefile @@ -76,7 +76,7 @@ MINIKUBE_RELEASES_URL=https://github.com/kubernetes/minikube/releases/download KERNEL_VERSION ?= 4.19.202 # latest from https://github.com/golangci/golangci-lint/releases # 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 GOLINT_JOBS ?= 4 # see https://github.com/golangci/golangci-lint#memory-usage-of-golangci-lint From 8c6f9f64c798ce8aa8bfd6aeb51bf52d6cff9298 Mon Sep 17 00:00:00 2001 From: Medya Gh Date: Mon, 31 Jan 2022 15:18:04 -0800 Subject: [PATCH 2/3] lint --- pkg/drivers/kic/oci/oci.go | 2 +- pkg/drivers/kvm/domain.go | 2 +- pkg/minikube/cruntime/containerd.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/drivers/kic/oci/oci.go b/pkg/drivers/kic/oci/oci.go index bde0430375..7954ead2f4 100644 --- a/pkg/drivers/kic/oci/oci.go +++ b/pkg/drivers/kic/oci/oci.go @@ -59,7 +59,7 @@ func DeleteContainersByLabel(ociBin string, label string) []error { // if it doesn't it means docker daemon is stuck and needs restart if err != nil { 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 } if err := ShutDown(ociBin, c); err != nil { diff --git a/pkg/drivers/kvm/domain.go b/pkg/drivers/kvm/domain.go index 31e68b9b47..360ae038ac 100644 --- a/pkg/drivers/kvm/domain.go +++ b/pkg/drivers/kvm/domain.go @@ -46,7 +46,7 @@ func (d *Driver) getDomain() (*libvirt.Domain, *libvirt.Connect, error) { func getConnection(connectionURI string) (*libvirt.Connect, error) { conn, err := libvirt.NewConnect(connectionURI) 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 diff --git a/pkg/minikube/cruntime/containerd.go b/pkg/minikube/cruntime/containerd.go index 9cf6947669..1a10b73dc1 100644 --- a/pkg/minikube/cruntime/containerd.go +++ b/pkg/minikube/cruntime/containerd.go @@ -168,7 +168,7 @@ func (r *Containerd) Version() (string, error) { c := exec.Command("containerd", "--version") rr, err := r.Runner.RunCmd(c) if err != nil { - return "", errors.Wrapf(err, "containerd check version.") + return "", errors.Wrapf(err, "containerd check version") } version, err := parseContainerdVersion(rr.Stdout.String()) if err != nil { From c24818d9b7c90eb5746921f38234e00944c94d44 Mon Sep 17 00:00:00 2001 From: Medya Gh Date: Tue, 1 Feb 2022 13:21:53 -0800 Subject: [PATCH 3/3] lint --- cmd/minikube/cmd/start.go | 2 +- pkg/drivers/kic/kic.go | 2 +- pkg/drivers/kic/oci/oci.go | 4 ++-- pkg/minikube/cruntime/containerd.go | 6 +++--- pkg/minikube/cruntime/crio.go | 6 +++--- pkg/minikube/cruntime/docker.go | 18 +++++++++--------- pkg/minikube/machine/fix.go | 2 +- 7 files changed, 20 insertions(+), 20 deletions(-) diff --git a/cmd/minikube/cmd/start.go b/cmd/minikube/cmd/start.go index 990341c767..86d790e2a9 100644 --- a/cmd/minikube/cmd/start.go +++ b/cmd/minikube/cmd/start.go @@ -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/")) { - 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 { diff --git a/pkg/drivers/kic/kic.go b/pkg/drivers/kic/kic.go index 90c1e2e443..c0f94908ba 100644 --- a/pkg/drivers/kic/kic.go +++ b/pkg/drivers/kic/kic.go @@ -158,7 +158,7 @@ func (d *Driver) Create() error { } else { // The conflicting container name was not created by minikube // 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) } } diff --git a/pkg/drivers/kic/oci/oci.go b/pkg/drivers/kic/oci/oci.go index 7954ead2f4..5f5a84ce8d 100644 --- a/pkg/drivers/kic/oci/oci.go +++ b/pkg/drivers/kic/oci/oci.go @@ -58,8 +58,8 @@ func DeleteContainersByLabel(ociBin string, label string) []error { // only try to delete if docker/podman inspect returns // if it doesn't it means docker daemon is stuck and needs restart if err != nil { - 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) + 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) continue } if err := ShutDown(ociBin, c); err != nil { diff --git a/pkg/minikube/cruntime/containerd.go b/pkg/minikube/cruntime/containerd.go index 1a10b73dc1..e8bb1567fd 100644 --- a/pkg/minikube/cruntime/containerd.go +++ b/pkg/minikube/cruntime/containerd.go @@ -194,7 +194,7 @@ func (r *Containerd) Active() bool { func (r *Containerd) Available() error { c := exec.Command("which", "containerd") if _, err := r.Runner.RunCmd(c); err != nil { - return errors.Wrap(err, "check containerd availability.") + return errors.Wrap(err, "check containerd availability") } 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)) if _, err := cr.RunCmd(c); err != nil { - return errors.Wrap(err, "generate containerd cfg.") + return errors.Wrap(err, "generate containerd cfg") } return nil } @@ -425,7 +425,7 @@ func (r *Containerd) BuildImage(src string, file string, tag string, push bool, c.Stdout = os.Stdout c.Stderr = os.Stderr if _, err := r.Runner.RunCmd(c); err != nil { - return errors.Wrap(err, "buildctl build.") + return errors.Wrap(err, "buildctl build") } return nil } diff --git a/pkg/minikube/cruntime/crio.go b/pkg/minikube/cruntime/crio.go index 85ea766b21..da7d6aa362 100644 --- a/pkg/minikube/cruntime/crio.go +++ b/pkg/minikube/cruntime/crio.go @@ -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)) if _, err := cr.RunCmd(c); err != nil { - return errors.Wrap(err, "generateCRIOConfig.") + return errors.Wrap(err, "generateCRIOConfig") } if cni.Network != "" { @@ -97,7 +97,7 @@ func (r *CRIO) Version() (string, error) { c := exec.Command("crio", "--version") rr, err := r.Runner.RunCmd(c) if err != nil { - return "", errors.Wrap(err, "crio version.") + return "", errors.Wrap(err, "crio version") } // crio version 1.13.0 @@ -118,7 +118,7 @@ func (r *CRIO) SocketPath() string { func (r *CRIO) Available() error { c := exec.Command("which", "crio") if _, err := r.Runner.RunCmd(c); err != nil { - return errors.Wrapf(err, "check crio available.") + return errors.Wrapf(err, "check crio available") } return nil } diff --git a/pkg/minikube/cruntime/docker.go b/pkg/minikube/cruntime/docker.go index fc23019c32..b7745ee3d4 100644 --- a/pkg/minikube/cruntime/docker.go +++ b/pkg/minikube/cruntime/docker.go @@ -254,7 +254,7 @@ func (r *Docker) LoadImage(path string) error { klog.Infof("Loading image: %s", path) c := exec.Command("/bin/bash", "-c", fmt.Sprintf("sudo cat %s | docker load", path)) if _, err := r.Runner.RunCmd(c); err != nil { - return errors.Wrap(err, "loadimage docker.") + return errors.Wrap(err, "loadimage docker") } return nil } @@ -267,7 +267,7 @@ func (r *Docker) PullImage(name string) error { } c := exec.Command("docker", "pull", name) if _, err := r.Runner.RunCmd(c); err != nil { - return errors.Wrap(err, "pull image docker.") + return errors.Wrap(err, "pull image docker") } return nil } @@ -277,7 +277,7 @@ func (r *Docker) SaveImage(name string, path string) error { 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)) if _, err := r.Runner.RunCmd(c); err != nil { - return errors.Wrap(err, "saveimage docker.") + return errors.Wrap(err, "saveimage docker") } return nil } @@ -290,7 +290,7 @@ func (r *Docker) RemoveImage(name string) error { } c := exec.Command("docker", "rmi", name) if _, err := r.Runner.RunCmd(c); err != nil { - return errors.Wrap(err, "remove image docker.") + return errors.Wrap(err, "remove image docker") } return nil } @@ -300,7 +300,7 @@ func (r *Docker) TagImage(source string, target string) error { klog.Infof("Tagging image %s: %s", source, target) c := exec.Command("docker", "tag", source, target) if _, err := r.Runner.RunCmd(c); err != nil { - return errors.Wrap(err, "tag image docker.") + return errors.Wrap(err, "tag image docker") } return nil } @@ -326,14 +326,14 @@ func (r *Docker) BuildImage(src string, file string, tag string, push bool, env c.Stdout = os.Stdout c.Stderr = os.Stderr if _, err := r.Runner.RunCmd(c); err != nil { - return errors.Wrap(err, "buildimage docker.") + return errors.Wrap(err, "buildimage docker") } if tag != "" && push { c := exec.Command("docker", "push", tag) c.Stdout = os.Stdout c.Stderr = os.Stderr if _, err := r.Runner.RunCmd(c); err != nil { - return errors.Wrap(err, "pushimage docker.") + return errors.Wrap(err, "pushimage docker") } } return nil @@ -344,7 +344,7 @@ func (r *Docker) PushImage(name string) error { klog.Infof("Pushing image: %s", name) c := exec.Command("docker", "push", name) if _, err := r.Runner.RunCmd(c); err != nil { - return errors.Wrap(err, "push image docker.") + return errors.Wrap(err, "push image docker") } return nil } @@ -422,7 +422,7 @@ func (r *Docker) KillContainers(ids []string) error { args := append([]string{"rm", "-f"}, ids...) c := exec.Command("docker", args...) if _, err := r.Runner.RunCmd(c); err != nil { - return errors.Wrap(err, "Killing containers docker.") + return errors.Wrap(err, "killing containers docker") } return nil } diff --git a/pkg/minikube/machine/fix.go b/pkg/minikube/machine/fix.go index dcd3d74a11..20cd801757 100644 --- a/pkg/minikube/machine/fix.go +++ b/pkg/minikube/machine/fix.go @@ -59,7 +59,7 @@ func fixHost(api libmachine.API, cc *config.ClusterConfig, n *config.Node) (*hos h, err := api.Load(config.MachineName(*cc, *n)) 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)