From d00faa90c70c35f96cb80466878569ae479adec1 Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Thu, 2 Jul 2026 19:15:06 -0400 Subject: [PATCH] pkg/utils: add ELN as supported distro Signed-off-by: Yaakov Selkowitz --- doc/toolbox.1.md | 4 +++- src/meson.build | 1 + src/pkg/utils/eln.go | 39 +++++++++++++++++++++++++++++++++++++ src/pkg/utils/utils.go | 9 +++++++++ src/pkg/utils/utils_test.go | 15 ++++++++++++++ 5 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 src/pkg/utils/eln.go diff --git a/doc/toolbox.1.md b/doc/toolbox.1.md index b30efd40c..75a092d95 100644 --- a/doc/toolbox.1.md +++ b/doc/toolbox.1.md @@ -55,7 +55,8 @@ distribution for creating containers. If the host is not supported, then it falls back to a Fedora image. Supported host operating systems are: * Arch Linux -* Fedora +* Fedora Linux +* Fedora ELN * Red Hat Enterprise Linux >= 8.5 * Ubuntu @@ -68,6 +69,7 @@ specifies its version. Supported combinations are: Distro |Release -------|---------- arch |latest or rolling +eln |latest fedora |\ or f\ eg., 36 or f36 rhel |\.\ eg., 8.5 ubuntu |\.\ eg., 22.04 diff --git a/src/meson.build b/src/meson.build index 6706fe28c..867ae0010 100644 --- a/src/meson.build +++ b/src/meson.build @@ -35,6 +35,7 @@ sources = files( 'pkg/term/term_test.go', 'pkg/utils/libsubid-wrappers.c', 'pkg/utils/arch.go', + 'pkg/utils/eln.go', 'pkg/utils/errors.go', 'pkg/utils/fedora.go', 'pkg/utils/rhel.go', diff --git a/src/pkg/utils/eln.go b/src/pkg/utils/eln.go new file mode 100644 index 000000000..c78cedd48 --- /dev/null +++ b/src/pkg/utils/eln.go @@ -0,0 +1,39 @@ +/* + * Copyright © 2021 – 2026 Red Hat Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package utils + +func getDefaultReleaseELN() (string, error) { + return "latest", nil +} + +func getFullyQualifiedImageELN(image, release string) string { + imageFull := "quay.io/fedora/" + image + return imageFull +} + +func getP11KitClientPathsELN() []string { + paths := []string{"/usr/lib64/pkcs11/p11-kit-client.so"} + return paths +} + +func parseReleaseELN(release string) (string, error) { + if release != "latest" && release != "" { + return "", &ParseReleaseError{"The release must be 'latest'."} + } + + return "latest", nil +} diff --git a/src/pkg/utils/utils.go b/src/pkg/utils/utils.go index f3de23b1b..17beabb2b 100644 --- a/src/pkg/utils/utils.go +++ b/src/pkg/utils/utils.go @@ -139,6 +139,15 @@ var ( getP11KitClientPathsArch, parseReleaseArch, }, + "eln": { + "eln-toolbox", + "eln-toolbox", + false, + getDefaultReleaseELN, + getFullyQualifiedImageELN, + getP11KitClientPathsELN, + parseReleaseELN, + }, "fedora": { "fedora-toolbox", "fedora-toolbox", diff --git a/src/pkg/utils/utils_test.go b/src/pkg/utils/utils_test.go index e9624be15..757409b43 100644 --- a/src/pkg/utils/utils_test.go +++ b/src/pkg/utils/utils_test.go @@ -103,6 +103,21 @@ func TestParseRelease(t *testing.T) { inputRelease: "foo", errMsg: "The release must be 'latest'.", }, + { + inputDistro: "eln", + inputRelease: "", + output: "latest", + }, + { + inputDistro: "eln", + inputRelease: "latest", + output: "latest", + }, + { + inputDistro: "eln", + inputRelease: "11", + errMsg: "The release must be 'latest'.", + }, { inputDistro: "fedora", inputRelease: "f34",