Skip to content

Commit 7ffbe66

Browse files
author
Genevieve LEsperance
committed
Absolutize the gcp service account key path
- if a file path is passed in. Otherwise, try the parameter as actual json.
1 parent f163aac commit 7ffbe66

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

gcp/leftovers.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"errors"
77
"fmt"
88
"io/ioutil"
9+
"path/filepath"
910
"sync"
1011

1112
"github.com/fatih/color"
@@ -95,7 +96,9 @@ func NewLeftovers(logger logger, keyPath string) (Leftovers, error) {
9596
return Leftovers{}, errors.New("Missing service account key path.")
9697
}
9798

98-
key, err := ioutil.ReadFile(keyPath)
99+
absKeyPath, _ := filepath.Abs(keyPath)
100+
101+
key, err := ioutil.ReadFile(absKeyPath)
99102
if err != nil {
100103
key = []byte(keyPath)
101104
}

0 commit comments

Comments
 (0)