fix: builder and sdk changes #81
1 changed files with 6 additions and 6 deletions
|
|
@ -103,14 +103,14 @@ func ResourceNameWithDateTime(name string) string {
|
||||||
|
|
||||||
func GetTestProjectServiceAccountJson(path string) string {
|
func GetTestProjectServiceAccountJson(path string) string {
|
||||||
var err error
|
var err error
|
||||||
token, tokenSet := os.LookupEnv("TF_ACC_SERVICE_ACCOUNT_FILE")
|
json, ok := os.LookupEnv("TF_ACC_SERVICE_ACCOUNT_JSON_CONTENT")
|
||||||
if !tokenSet || token == "" {
|
if !ok || json == "" {
|
||||||
token, err = readTestServiceAccountJsonFromFile(path)
|
json, err = readTestServiceAccountJsonFromFile(path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return token
|
return json
|
||||||
}
|
}
|
||||||
|
|
||||||
// func GetTestProjectServiceAccountToken(path string) string {
|
// func GetTestProjectServiceAccountToken(path string) string {
|
||||||
|
|
@ -157,8 +157,8 @@ func GetTestProjectServiceAccountJson(path string) string {
|
||||||
|
|
||||||
func readTestServiceAccountJsonFromFile(path string) (string, error) {
|
func readTestServiceAccountJsonFromFile(path string) (string, error) {
|
||||||
if path == "" {
|
if path == "" {
|
||||||
customPath, customPathSet := os.LookupEnv("STACKIT_SERVICE_ACCOUNT_PATH")
|
customPath, ok := os.LookupEnv("TF_ACC_SERVICE_ACCOUNT_FILE")
|
||||||
if !customPathSet || customPath == "" {
|
if !ok || customPath == "" {
|
||||||
path = serviceAccountFilePath
|
path = serviceAccountFilePath
|
||||||
home, err := os.UserHomeDir()
|
home, err := os.UserHomeDir()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue