fix: tf acc test pipeline
Some checks failed
CI Workflow / Check GoReleaser config (pull_request) Successful in 5s
CI Workflow / Test readiness for publishing provider (pull_request) Has been cancelled
CI Workflow / CI run tests (pull_request) Has been cancelled
CI Workflow / CI run build and linting (pull_request) Has been cancelled
CI Workflow / Code coverage report (pull_request) Has been cancelled
CI Workflow / Prepare GO cache (pull_request) Has been cancelled
Some checks failed
CI Workflow / Check GoReleaser config (pull_request) Successful in 5s
CI Workflow / Test readiness for publishing provider (pull_request) Has been cancelled
CI Workflow / CI run tests (pull_request) Has been cancelled
CI Workflow / CI run build and linting (pull_request) Has been cancelled
CI Workflow / Code coverage report (pull_request) Has been cancelled
CI Workflow / Prepare GO cache (pull_request) Has been cancelled
This commit is contained in:
parent
afe4d490e7
commit
f6e6f968d8
1 changed files with 6 additions and 6 deletions
|
|
@ -103,14 +103,14 @@ func ResourceNameWithDateTime(name string) string {
|
|||
|
||||
func GetTestProjectServiceAccountJson(path string) string {
|
||||
var err error
|
||||
token, tokenSet := os.LookupEnv("TF_ACC_SERVICE_ACCOUNT_FILE")
|
||||
if !tokenSet || token == "" {
|
||||
token, err = readTestServiceAccountJsonFromFile(path)
|
||||
json, ok := os.LookupEnv("TF_ACC_SERVICE_ACCOUNT_JSON_CONTENT")
|
||||
if !ok || json == "" {
|
||||
json, err = readTestServiceAccountJsonFromFile(path)
|
||||
if err != nil {
|
||||
return ""
|
||||
}
|
||||
}
|
||||
return token
|
||||
return json
|
||||
}
|
||||
|
||||
// func GetTestProjectServiceAccountToken(path string) string {
|
||||
|
|
@ -157,8 +157,8 @@ func GetTestProjectServiceAccountJson(path string) string {
|
|||
|
||||
func readTestServiceAccountJsonFromFile(path string) (string, error) {
|
||||
if path == "" {
|
||||
customPath, customPathSet := os.LookupEnv("STACKIT_SERVICE_ACCOUNT_PATH")
|
||||
if !customPathSet || customPath == "" {
|
||||
customPath, ok := os.LookupEnv("TF_ACC_SERVICE_ACCOUNT_FILE")
|
||||
if !ok || customPath == "" {
|
||||
path = serviceAccountFilePath
|
||||
home, err := os.UserHomeDir()
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue