Skip to content

Commit

Permalink
Also generate the go-openssl container variants
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkmueller committed Jul 6, 2023
1 parent 2040e10 commit 5a9ab61
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions src/bci_build/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -1371,22 +1371,25 @@ 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}"
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{variant}-{stability_tag}-image",
"pretty_name": f"Go{variant} {ver} development",
"name": f"golang{variant}",
"stability_tag": stability_tag,
"pretty_name": f"Golang {ver}",
"pretty_name": f"Golang{variant} {ver}",
"is_latest": (is_stable and (os_version in CAN_BE_LATEST_OS_VERSION)),
"version": ver,
"env": {
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 5a9ab61

Please sign in to comment.