Skip to content

Commit b23b1e1

Browse files
committed
Update IsRunningInProw check
1 parent a03a482 commit b23b1e1

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

test/utils/credentials/credentials.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ func CreateAzureCredentialFile(isAzureChinaCloud bool) (*Credentials, error) {
134134
// If the tests are being run in Prow, credentials are not supplied through env vars. Instead, it is supplied
135135
// through env var AZURE_CREDENTIALS. We need to convert it to AZURE_CREDENTIAL_FILE for sanity, integration and E2E tests
136136
// https://github.com/kubernetes/test-infra/blob/master/config/jobs/kubernetes/cloud-provider-azure/cloud-provider-azure-config.yaml#L5-L6
137-
if testutil.IsRunningInProw() {
137+
if testutil.IsRunningInAzureProw() {
138138
log.Println("Running in Prow, converting AZURE_CREDENTIALS to AZURE_CREDENTIAL_FILE")
139139
c, err := getCredentialsFromAzureCredentials(os.Getenv("AZURE_CREDENTIALS"))
140140
if err != nil {

test/utils/testutil/testutil.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,15 @@ func AssertError(actual *TestError, expected error) bool {
5050
}
5151

5252
func IsRunningInProw() bool {
53+
return IsRunningInAzureProw() || IsRunningInGcpProw()
54+
}
55+
56+
func IsRunningInGcpProw() bool {
57+
_, ok := os.LookupEnv("GOOGLE_APPLICATION_CREDENTIAL")
58+
return ok
59+
}
60+
61+
func IsRunningInAzureProw() bool {
5362
_, ok := os.LookupEnv("AZURE_CREDENTIALS")
5463
return ok
5564
}

0 commit comments

Comments
 (0)