Skip to content

Commit 8ee6e36

Browse files
committed
make suffix in s3 artifact manifest not contain cname
to parse this correctly in GLCI
1 parent 3fbd5cb commit 8ee6e36

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/gardenlinux/s3/s3_artifacts.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,11 +169,18 @@ def upload_from_directory(
169169
md5sum = file_digest(fp, "md5").hexdigest()
170170
sha256sum = file_digest(fp, "sha256").hexdigest()
171171

172+
if artifact.name.startswith(cname):
173+
suffix = artifact.name[len(cname) :]
174+
else:
175+
raise RuntimeError(
176+
f"Artifact name '{artifact.name}' does not start with cname '{cname}'"
177+
)
178+
172179
artifact_metadata = {
173180
"name": artifact.name,
174181
"s3_bucket_name": self._bucket.name,
175182
"s3_key": s3_key,
176-
"suffix": "".join(artifact.suffixes),
183+
"suffix": suffix,
177184
"md5sum": md5sum,
178185
"sha256sum": sha256sum,
179186
}

0 commit comments

Comments
 (0)