Skip to content

Commit 3085d33

Browse files
marmijojlebon
authored andcommitted
utils.groovy: factor out rpm_to_go_arch() helper
Move the architecture alias map into a new rpm_to_go_arch() helper function to avoid duplication and ensure consistent mapping from RPM-style arch names to Go-style names (e.g., x86_64 → amd64) used by skopeo and container manifests. Update brew_upload() to use this new helper
1 parent 039ed6d commit 3085d33

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

utils.groovy

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -975,14 +975,8 @@ def get_arch_image_digest(from) {
975975
def brew_upload(arches, release, repo, manifest_digest, extensions_manifest_digest, version, pipecfg) {
976976
def node_digest_arch_map = get_arch_image_digest("${repo}@${manifest_digest}")
977977
def extensions_node_digest_arch_map = get_arch_image_digest("${repo}@${extensions_manifest_digest}")
978-
def archAliasMap = [
979-
"x86_64" : "amd64",
980-
"aarch64" : "arm64",
981-
"s390x" : "s390x",
982-
"ppc64le" : "ppc64le"
983-
]
984978
for (arch in arches) {
985-
def inspect_arch = archAliasMap[arch]
979+
def inspect_arch = rpm_to_go_arch(arch)
986980
def node_image = "${repo}@${node_digest_arch_map[inspect_arch]}"
987981
def extensions_node_image = "${repo}@${extensions_node_digest_arch_map[inspect_arch]}"
988982

@@ -1006,4 +1000,16 @@ def brew_upload(arches, release, repo, manifest_digest, extensions_manifest_dige
10061000
}
10071001
}
10081002

1003+
// maps RPM-style architecture names to Go-style architecture names
1004+
// used by skopeo and container manifests.
1005+
def rpm_to_go_arch(arch) {
1006+
def archAliasMap = [
1007+
"x86_64" : "amd64",
1008+
"aarch64" : "arm64",
1009+
"s390x" : "s390x",
1010+
"ppc64le" : "ppc64le"
1011+
]
1012+
return archAliasMap[arch]
1013+
}
1014+
10091015
return this

0 commit comments

Comments
 (0)