fix(promote): fetch registry manifest digest
This commit is contained in:
@@ -80,8 +80,9 @@ jobs:
|
|||||||
'application/vnd.docker.distribution.manifest.v2+json',
|
'application/vnd.docker.distribution.manifest.v2+json',
|
||||||
]),
|
]),
|
||||||
}
|
}
|
||||||
request = urllib.request.Request(manifest_url, headers=manifest_headers, method='HEAD')
|
request = urllib.request.Request(manifest_url, headers=manifest_headers)
|
||||||
with urllib.request.urlopen(request, timeout=30) as response:
|
with urllib.request.urlopen(request, timeout=30) as response:
|
||||||
|
response.read()
|
||||||
digest = response.headers.get('Docker-Content-Digest', '')
|
digest = response.headers.get('Docker-Content-Digest', '')
|
||||||
if not re.fullmatch(r'sha256:[0-9a-f]{64}', digest):
|
if not re.fullmatch(r'sha256:[0-9a-f]{64}', digest):
|
||||||
raise SystemExit(f'Registry returned invalid manifest digest for {tag}')
|
raise SystemExit(f'Registry returned invalid manifest digest for {tag}')
|
||||||
|
|||||||
@@ -80,8 +80,9 @@ jobs:
|
|||||||
'application/vnd.docker.distribution.manifest.v2+json',
|
'application/vnd.docker.distribution.manifest.v2+json',
|
||||||
]),
|
]),
|
||||||
}
|
}
|
||||||
request = urllib.request.Request(manifest_url, headers=manifest_headers, method='HEAD')
|
request = urllib.request.Request(manifest_url, headers=manifest_headers)
|
||||||
with urllib.request.urlopen(request, timeout=30) as response:
|
with urllib.request.urlopen(request, timeout=30) as response:
|
||||||
|
response.read()
|
||||||
digest = response.headers.get('Docker-Content-Digest', '')
|
digest = response.headers.get('Docker-Content-Digest', '')
|
||||||
if not re.fullmatch(r'sha256:[0-9a-f]{64}', digest):
|
if not re.fullmatch(r'sha256:[0-9a-f]{64}', digest):
|
||||||
raise SystemExit(f'Registry returned invalid manifest digest for {tag}')
|
raise SystemExit(f'Registry returned invalid manifest digest for {tag}')
|
||||||
|
|||||||
Reference in New Issue
Block a user