fix(helm): increase default helm timeouts [EE-6617]

pull/11031/head
Matt Hook 2024-01-29 13:03:11 +13:00 committed by GitHub
parent 46b2175729
commit 8a98704111
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 8 additions and 3 deletions

View File

@ -52,13 +52,14 @@ func (hbpm *helmBinaryPackageManager) SearchRepo(searchRepoOpts options.SearchRe
}
client := searchRepoOpts.Client
if searchRepoOpts.Client == nil {
if client == nil {
// The current index.yaml is ~9MB on bitnami.
// At a slow @2mbit download = 40s. @100bit = ~1s.
// I'm seeing 3 - 4s over wifi.
// Give ample time but timeout for now. Can be improved in the future
client = &http.Client{
Timeout: 60 * time.Second,
Timeout: 300 * time.Second,
Transport: http.DefaultTransport,
}
}

View File

@ -26,6 +26,8 @@ func Test_SearchRepo(t *testing.T) {
{"portainer helm repo", "https://portainer.github.io/k8s/", false},
{"gitlap helm repo with trailing slash", "https://charts.gitlab.io/", false},
{"elastic helm repo with trailing slash", "https://helm.elastic.co/", false},
{"fabric8.io helm repo with trailing slash", "https://fabric8.io/helm/", false},
{"lensesio helm repo without trailing slash", "https://lensesio.github.io/kafka-helm-charts", false},
}
for _, test := range tests {

View File

@ -28,7 +28,7 @@ func ValidateHelmRepositoryURL(repoUrl string, client *http.Client) error {
if client == nil {
client = &http.Client{
Timeout: time.Second * 10,
Timeout: time.Second * 120,
Transport: http.DefaultTransport,
}
}

View File

@ -31,6 +31,8 @@ func Test_ValidateHelmRepositoryURL(t *testing.T) {
{"portainer helm repo", "https://portainer.github.io/k8s/", false},
{"elastic helm repo", "https://helm.elastic.co/", false},
{"redirect", "https://charts.jetstack.io/", false},
{"fabric8.io helm repo", "https://fabric8.io/helm/", false},
{"lensesio helm repo", "https://lensesio.github.io/kafka-helm-charts", false},
}
for _, test := range tests {