Skip to content

Commit

Permalink
Also generate the go-openssl container variants (jsc#PED-4529)
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkmueller committed Jul 6, 2023
1 parent 2040e10 commit 97c4251
Showing 1 changed file with 20 additions and 10 deletions.
30 changes: 20 additions & 10 deletions src/bci_build/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -1371,24 +1371,27 @@ def _get_ruby_kwargs(ruby_version: Literal["2.5", "3.2"], os_version: OsVersion)

_GO_VER_T = Literal["1.19", "1.20"]
_GOLANG_VERSIONS: List[_GO_VER_T] = ["1.19", "1.20"]
_GOLANG_VARIANTS: List[Literal] = ["", "-openssl"]

assert len(_GOLANG_VERSIONS) == 2, "Only two golang versions must be supported"


def _get_golang_kwargs(ver: _GO_VER_T, os_version: OsVersion):
def _get_golang_kwargs(
ver: _GO_VER_T, variant: _GOLANG_VARIANTS, os_version: OsVersion
):
golang_version_regex = "%%golang_version%%"
is_stable = ver == _GOLANG_VERSIONS[-1]
stability_tag = "stable" if is_stable else "oldstable"
go = f"go{ver}"
stability_tag = f"stable{variant}" if is_stable else f"oldstable{variant}"
go = f"go{ver}{variant}"
return {
"os_version": os_version,
"package_name": f"golang-{stability_tag}-image",
"pretty_name": f"Go {ver} development",
"name": "golang",
"package_name": f"golang-{stability_tag}{variant}-image",
"pretty_name": f"Go {ver}{variant} development",
"name": f"golang",
"stability_tag": stability_tag,
"pretty_name": f"Golang {ver}",
"pretty_name": f"Golang {ver}{variant}",
"is_latest": (is_stable and (os_version in CAN_BE_LATEST_OS_VERSION)),
"version": ver,
"version": f"{ver}{variant}",
"env": {
"GOLANG_VERSION": golang_version_regex,
"GOPATH": "/go",
Expand All @@ -1409,9 +1412,16 @@ def _get_golang_kwargs(ver: _GO_VER_T, os_version: OsVersion):

GOLANG_IMAGES = [
LanguageStackContainer(
**_get_golang_kwargs(ver, os_version), support_level=SupportLevel.L3
**_get_golang_kwargs(ver, govariant, OsVersion.SP5),
support_level=SupportLevel.L3,
)
for ver, govariant in product(_GOLANG_VERSIONS, _GOLANG_VARIANTS)
] + [
LanguageStackContainer(
**_get_golang_kwargs(ver, "", OsVersion.TUMBLEWEED),
support_level=SupportLevel.L3,
)
for ver, os_version in product(_GOLANG_VERSIONS, ALL_NONBASE_OS_VERSIONS)
for ver in _GOLANG_VERSIONS
]

# see https://raw.githubusercontent.com/nodejs/Release/main/README.md
Expand Down

0 comments on commit 97c4251

Please sign in to comment.