summaryrefslogtreecommitdiff
path: root/gcp
diff options
context:
space:
mode:
Diffstat (limited to 'gcp')
-rw-r--r--gcp/meta.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/gcp/meta.go b/gcp/meta.go
index 894e9445..bf80821b 100644
--- a/gcp/meta.go
+++ b/gcp/meta.go
@@ -1,6 +1,7 @@
package gcp
import (
+ "fmt"
"io/ioutil"
"net/http"
"strconv"
@@ -8,8 +9,6 @@ import (
"sync"
"time"
- "github.com/pkg/errors"
-
"github.com/hairyhenderson/gomplate/v3/env"
)
@@ -39,7 +38,7 @@ func GetClientOptions() ClientOptions {
t, err := strconv.Atoi(timeout)
if err != nil {
- panic(errors.Wrapf(err, "Invalid GCP_TIMEOUT value '%s' - must be an integer\n", timeout))
+ panic(fmt.Errorf("invalid GCP_TIMEOUT value '%s' - must be an integer: %w", timeout, err))
}
co.Timeout = time.Duration(t) * time.Millisecond
@@ -113,7 +112,7 @@ func (c *MetaClient) retrieveMetadata(url string, def ...string) (string, error)
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
- return "", errors.Wrapf(err, "Failed to read response body from %s", url)
+ return "", fmt.Errorf("failed to read response body from %s: %w", url, err)
}
value := strings.TrimSpace(string(body))
c.cache[url] = value