From b3d7834be1f857c5f5bda0dd656f9ceaa526bfc2 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Tue, 20 Feb 2024 09:54:57 -0800 Subject: [PATCH] distributions: add Fedora 41 Fedora 40 branched around 2024-02-14, so Rawhide now "is" (to some extent) Fedora 41. Modular repos are omitted because Fedora has no Modular content since F39. For F39+ and F40 the metalinks just redirect to the Everything repository. Signed-off-by: Adam Williamson --- distributions/fedora-41/fedora-41.json | 51 ++++++++++++++++++++ internal/distribution/distroregistry_test.go | 4 +- internal/v1/api.go | 1 + internal/v1/api.yaml | 1 + internal/v1/handler_test.go | 4 +- 5 files changed, 57 insertions(+), 4 deletions(-) create mode 100644 distributions/fedora-41/fedora-41.json diff --git a/distributions/fedora-41/fedora-41.json b/distributions/fedora-41/fedora-41.json new file mode 100644 index 000000000..7e7f77f85 --- /dev/null +++ b/distributions/fedora-41/fedora-41.json @@ -0,0 +1,51 @@ +{ + "module_platform_id": "platform:f41", + "oscap_name": "fedora", + "distribution": { + "name": "fedora-41", + "description": "Fedora Linux 41", + "no_package_list": true, + "restricted_access": true + }, + "x86_64": { + "image_types": [ + "aws", + "azure", + "guest-image", + "oci", + "vsphere", + "vsphere-ova", + "iot-commit" + ], + "repositories": [ + { + "id": "fedora", + "metalink": "https://mirrors.fedoraproject.org/metalink?repo=fedora-41&arch=x86_64", + "rhsm": false + }, + { + "id": "updates", + "metalink": "https://mirrors.fedoraproject.org/metalink?repo=updates-released-f41&arch=x86_64", + "rhsm": false + } + ] + }, + "aarch64": { + "image_types": [ + "aws", + "guest-image" + ], + "repositories": [ + { + "id": "fedora", + "metalink": "https://mirrors.fedoraproject.org/metalink?repo=fedora-41&arch=aarch64", + "rhsm": false + }, + { + "id": "updates", + "metalink": "https://mirrors.fedoraproject.org/metalink?repo=updates-released-f41&arch=aarch64", + "rhsm": false + } + ] + } +} diff --git a/internal/distribution/distroregistry_test.go b/internal/distribution/distroregistry_test.go index 51dd0f31e..520b0be5a 100644 --- a/internal/distribution/distroregistry_test.go +++ b/internal/distribution/distroregistry_test.go @@ -9,8 +9,8 @@ import ( ) func TestDistroRegistry_List(t *testing.T) { - allDistros := []string{"rhel-8", "rhel-8-nightly", "rhel-84", "rhel-85", "rhel-86", "rhel-87", "rhel-88", "rhel-89", "rhel-9", "rhel-9-nightly", "rhel-90", "rhel-91", "rhel-92", "rhel-93", "centos-8", "centos-9", "fedora-37", "fedora-38", "fedora-39", "fedora-40"} - notEntitledDistros := []string{"rhel-8-nightly", "rhel-9-nightly", "centos-8", "centos-9", "fedora-37", "fedora-38", "fedora-39", "fedora-40"} + allDistros := []string{"rhel-8", "rhel-8-nightly", "rhel-84", "rhel-85", "rhel-86", "rhel-87", "rhel-88", "rhel-89", "rhel-9", "rhel-9-nightly", "rhel-90", "rhel-91", "rhel-92", "rhel-93", "centos-8", "centos-9", "fedora-37", "fedora-38", "fedora-39", "fedora-40", "fedora-41"} + notEntitledDistros := []string{"rhel-8-nightly", "rhel-9-nightly", "centos-8", "centos-9", "fedora-37", "fedora-38", "fedora-39", "fedora-40", "fedora-41"} dr, err := LoadDistroRegistry("../../distributions") require.NoError(t, err) diff --git a/internal/v1/api.go b/internal/v1/api.go index 7fe8f8937..816fa4645 100644 --- a/internal/v1/api.go +++ b/internal/v1/api.go @@ -63,6 +63,7 @@ const ( Fedora38 Distributions = "fedora-38" Fedora39 Distributions = "fedora-39" Fedora40 Distributions = "fedora-40" + Fedora41 Distributions = "fedora-41" Rhel8 Distributions = "rhel-8" Rhel84 Distributions = "rhel-84" Rhel85 Distributions = "rhel-85" diff --git a/internal/v1/api.yaml b/internal/v1/api.yaml index bcfef03b3..2c5b898fe 100644 --- a/internal/v1/api.yaml +++ b/internal/v1/api.yaml @@ -1003,6 +1003,7 @@ components: - fedora-38 - fedora-39 - fedora-40 + - fedora-41 ImageRequest: type: object additionalProperties: false diff --git a/internal/v1/handler_test.go b/internal/v1/handler_test.go index 72242ccbc..0dcfc2cb1 100644 --- a/internal/v1/handler_test.go +++ b/internal/v1/handler_test.go @@ -762,7 +762,7 @@ func TestGetDistributions(t *testing.T) { for _, distro := range result { distros = append(distros, distro.Name) } - require.ElementsMatch(t, []string{"rhel-8", "rhel-8-nightly", "rhel-84", "rhel-85", "rhel-86", "rhel-87", "rhel-88", "rhel-89", "rhel-9", "rhel-9-nightly", "rhel-90", "rhel-91", "rhel-92", "rhel-93", "centos-8", "centos-9", "fedora-37", "fedora-38", "fedora-39", "fedora-40"}, distros) + require.ElementsMatch(t, []string{"rhel-8", "rhel-8-nightly", "rhel-84", "rhel-85", "rhel-86", "rhel-87", "rhel-88", "rhel-89", "rhel-9", "rhel-9-nightly", "rhel-90", "rhel-91", "rhel-92", "rhel-93", "centos-8", "centos-9", "fedora-37", "fedora-38", "fedora-39", "fedora-40", "fedora-41"}, distros) }) t.Run("No access to restricted distributions except global filter", func(t *testing.T) { @@ -855,7 +855,7 @@ func TestGetProfiles(t *testing.T) { }) t.Run("Access profiles on the other distros returns an error", func(t *testing.T) { - for _, dist := range []Distributions{Fedora37, Fedora38, Fedora39, Fedora40, Rhel90} { + for _, dist := range []Distributions{Fedora37, Fedora38, Fedora39, Fedora40, Fedora41, Rhel90} { respStatusCode, _ := tutils.GetResponseBody(t, fmt.Sprintf("http://localhost:8086/api/image-builder/v1/oscap/%s/profiles", dist), &tutils.AuthString0) require.Equal(t, http.StatusBadRequest, respStatusCode)