From 922db9a8c63c7b913387d313a6fc556ee36282fa Mon Sep 17 00:00:00 2001 From: Chris Broadfoot Date: Thu, 15 Dec 2016 22:28:39 -0800 Subject: [PATCH] pkg/minikube: fix uses of errors.Wrapf --- pkg/minikube/cluster/cluster.go | 12 ++++++------ pkg/minikube/kubeconfig/config.go | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pkg/minikube/cluster/cluster.go b/pkg/minikube/cluster/cluster.go index 09fb9349b2..25b7e364eb 100644 --- a/pkg/minikube/cluster/cluster.go +++ b/pkg/minikube/cluster/cluster.go @@ -91,10 +91,10 @@ func StartHost(api libmachine.API, config MachineConfig) (*host.Host, error) { if s != state.Running { if err := h.Driver.Start(); err != nil { - return nil, errors.Wrapf(err, "Error starting stopped host") + return nil, errors.Wrap(err, "Error starting stopped host") } if err := api.Save(h); err != nil { - return nil, errors.Wrapf(err, "Error saving started host") + return nil, errors.Wrap(err, "Error saving started host") } } @@ -133,7 +133,7 @@ func GetHostStatus(api libmachine.API) (string, error) { dne := "Does Not Exist" exists, err := api.Exists(constants.MachineName) if err != nil { - return "", errors.Wrapf(err, "Error checking that api exists for: ", constants.MachineName) + return "", errors.Wrapf(err, "Error checking that api exists for: %s", constants.MachineName) } if !exists { return dne, nil @@ -141,7 +141,7 @@ func GetHostStatus(api libmachine.API) (string, error) { host, err := api.Load(constants.MachineName) if err != nil { - return "", errors.Wrapf(err, "Error loading api for: ", constants.MachineName) + return "", errors.Wrapf(err, "Error loading api for: %s", constants.MachineName) } s, err := host.Driver.GetState() @@ -474,7 +474,7 @@ func GetHostLogs(api libmachine.API) (string, error) { func CheckIfApiExistsAndLoad(api libmachine.API) (*host.Host, error) { exists, err := api.Exists(constants.MachineName) if err != nil { - return nil, errors.Wrapf(err, "Error checking that api exists for: ", constants.MachineName) + return nil, errors.Wrapf(err, "Error checking that api exists for: %s", constants.MachineName) } if !exists { return nil, errors.Errorf("Machine does not exist for api.Exists(%s)", constants.MachineName) @@ -482,7 +482,7 @@ func CheckIfApiExistsAndLoad(api libmachine.API) (*host.Host, error) { host, err := api.Load(constants.MachineName) if err != nil { - return nil, errors.Wrapf(err, "Error loading api for: ", constants.MachineName) + return nil, errors.Wrapf(err, "Error loading api for: %s", constants.MachineName) } return host, nil } diff --git a/pkg/minikube/kubeconfig/config.go b/pkg/minikube/kubeconfig/config.go index 874daa1435..9ce97fffa9 100644 --- a/pkg/minikube/kubeconfig/config.go +++ b/pkg/minikube/kubeconfig/config.go @@ -35,7 +35,7 @@ func ReadConfigOrNew(filename string) (*api.Config, error) { if os.IsNotExist(err) { return api.NewConfig(), nil } else if err != nil { - return nil, errors.Wrapf(err, "Error reading file", filename) + return nil, errors.Wrapf(err, "Error reading file %q", filename) } // decode config, empty if no bytes