Skip to content

Commit 4643446

Browse files
committed
e2e: use gcr.io/cloud-builders/curl instead of dockerqa/curl
According to https://docs.docker.com/docker-hub/download-rate-limit/ For anonymous users, the rate limit is set to 100 pulls per 6 hours per IP address. For authenticated users, it’s 200 pulls per 6 hour period. Users with a paid Docker subscription get up to 5000 pulls per day. https://github.com/GoogleCloudPlatform/cloud-builders/blob/master/curl/README.md
1 parent 2da1689 commit 4643446

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

test/e2e/common.go

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import (
2424
"path/filepath"
2525
"strings"
2626
"time"
27+
"strconv"
2728

2829
apierrors "k8s.io/apimachinery/pkg/api/errors"
2930

@@ -205,18 +206,20 @@ func DeployAppToWorkloadClusterAndWaitForDeploymentReady(ctx context.Context, wo
205206
func DownloadFromAppInWorkloadCluster(ctx context.Context, workloadKubeconfigPath string, appName string, port int, path string) (string, error) {
206207
runArgs := []string{
207208
// Required by below: container name is runArg zero.
208-
"dummy", "-i", "--restart=Never", "--image=dockerqa/curl:ubuntu-trusty", "--command", "--", "curl", "--silent", "--show-error", fmt.Sprintf("%s:%d%s", appName, port, path),
209+
"dummy", "-i", "--restart=Never", "--image=gcr.io/cloud-builders/curl", "--command", "--", "curl", "--silent", "--show-error", fmt.Sprintf("%s:%d%s", appName, port, path),
209210
}
210211
var result, err = KubectlExec(ctx, "run", workloadKubeconfigPath, runArgs...)
211212
if err != nil {
212213
return result, err
213214
}
214-
if result == "" {
215+
numRetries := 3
216+
for result == "" && numRetries > 0 {
215217
// A single retry to accommodate occasional cases where an empty string is returned, ostensibly
216218
// because the service isn't fully ready. Subsequent requests have always worked.
217-
fmt.Println("Retrying html download")
219+
numRetries--
220+
fmt.Println("Retrying html download. Number of retries remaining:", numRetries)
218221
time.Sleep(5 * time.Second)
219-
runArgs[0] = "dummy2" // Assumed: container name is runArg zero.
222+
runArgs[0] = "dummy" + strconv.Itoa(numRetries) // Assumed: container name is runArg zero.
220223
result, err = KubectlExec(ctx, "run", workloadKubeconfigPath, runArgs...)
221224
}
222225
return result, err
@@ -232,7 +235,7 @@ func DownloadMetricsFromCAPCManager(ctx context.Context, bootstrapKubeconfigPath
232235

233236
// Scrape the metrics from the service
234237
runArgs = []string{
235-
"-i", "--restart=Never", "dummy", "--image=dockerqa/curl:ubuntu-trusty", "--command", "--", "curl", "--silent", "capc-controller-manager-metrics.capc-system:8080/metrics",
238+
"-i", "--restart=Never", "dummy", "--image=gcr.io/cloud-builders/curl", "--command", "--", "curl", "--silent", "capc-controller-manager-metrics.capc-system:8080/metrics",
236239
}
237240
result, err := KubectlExec(ctx, "run", bootstrapKubeconfigPath, runArgs...)
238241
Ω(err).ShouldNot(HaveOccurred())

0 commit comments

Comments
 (0)