Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions scripts/src/chartprreview/chartprreview.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
import sys

import requests
from requests.adapters import HTTPAdapter
from urllib3.util import Retry
import semantic_version
import semver
import yaml
Expand Down Expand Up @@ -459,15 +457,7 @@ def verify_package_digest(url, report):
target_digest = None
pkg_digest = None

retry = Retry(
total=3,
backoff_factor=2,
status_forcelist=[404, 429, 500, 502, 503, 504],
)
session = requests.Session()
session.mount("https://", HTTPAdapter(max_retries=retry))

response = session.get(url)
response = requests.get(url, allow_redirects=True)
if response.status_code == 200:
target_digest = hashlib.sha256(response.content).hexdigest()

Expand Down
15 changes: 13 additions & 2 deletions scripts/src/updateindex/updateindex.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
import requests
import yaml
from environs import Env
from requests.adapters import HTTPAdapter
from urllib3.util import Retry

try:
from yaml import CDumper as Dumper
Expand Down Expand Up @@ -105,7 +107,7 @@ def set_package_digest(chart_entry, chart_url):
"""Check that the digest of the provided chart matches the digest of the chart that
has been uploaded in the GitHub release.

Note that this is the reason why the GitHub release must have been created before
Note that this is the reason why the GitHub release must have been created before
updating the index.

Args:
Expand All @@ -115,7 +117,16 @@ def set_package_digest(chart_entry, chart_url):
"""
print("[INFO] set package digests.")

head = requests.head(chart_url, allow_redirects=True)
retry = Retry(
total=3,
backoff_factor=2,
status_forcelist=[404, 429, 500, 502, 503, 504],
raise_on_status=False,
)
session = requests.Session()
session.mount("https://", HTTPAdapter(max_retries=retry))

head = session.head(chart_url, allow_redirects=True)
print(f"[DEBUG]: tgz url : {chart_url}")
print(f"[DEBUG]: response code from head request: {head.status_code}")

Expand Down
Loading