Skip to content

Conversation

@piyush-jena
Copy link

@piyush-jena piyush-jena commented Dec 16, 2025

Description of changes:
This PR allows creation of aliases for packages whose name is changed so as to support multiple versions of the same package. For example: bottlerocket-core-kit supports containerd-1.7, containerd-2.0 and containerd-2.1. With this change, we allow creation of aliases so that we get additional entries in the application-inventory.json which can ensure that compliance solutions are able to properly track the old packages with new names.

Testing done:
These changes may or may not be valid for the actual repo but attempts to test corner cases.
I added the following Obsoletes in containerd-2.0

Obsoletes: %{_cross_os}%{gorepo}
Obsoletes: %{_cross_os}%{gorepo}-1.7
Obsoletes: %{_cross_os}%{gorepo} <= 1.7.15

This the output I got after making the above change for containerd-2.0, building the package and mounting the rpm in a bottlerocket-sdk container.

bash-5.2$ rpm -qp --queryformat '[%{OBSOLETES}\n]' /containerd-2.0/bottlerocket-containerd-2.0-2.0.7-1.1764962845.9b3a8b3a.br1.x86_64.rpm
bottlerocket-containerd
bottlerocket-containerd
bottlerocket-containerd-1.7

I used the above to write the logic. I added Obsoletes for systemd-252 as well.

Additional entries in application-inventory.json

   {
      "Name": "containerd",
      "Publisher": "Bottlerocket",
      "Version": "2.0.7",
      "Release": "1.1764962845.9b3a8b3a.br1",
      "Epoch": "1",
      "InstalledTime": "2025-12-18T19:28:28Z",
      "ApplicationType": "Unspecified",
      "Architecture": "x86_64",
      "Url": "https://github.com/containerd/containerd",
      "Summary": "An industry-standard container runtime"
    },
    {
      "Name": "containerd-1.7",
      "Publisher": "Bottlerocket",
      "Version": "2.0.7",
      "Release": "1.1764962845.9b3a8b3a.br1",
      "Epoch": "1",
      "InstalledTime": "2025-12-18T19:28:28Z",
      "ApplicationType": "Unspecified",
      "Architecture": "x86_64",
      "Url": "https://github.com/containerd/containerd",
      "Summary": "An industry-standard container runtime"
    },
    {
      "Name": "systemd",
      "Publisher": "Bottlerocket",
      "Version": "252.39",
      "Release": "1.1764962845.9b3a8b3a.br1",
      "Epoch": "0",
      "InstalledTime": "2025-12-18T19:28:28Z",
      "ApplicationType": "Unspecified",
      "Architecture": "x86_64",
      "Url": "https://www.freedesktop.org/wiki/Software/systemd",
      "Summary": "System and Service Manager"
    }

containerd-2.0

Obsoletes: %{_cross_os}%{gorepo}
Obsoletes: %{_cross_os}%{gorepo}-1.7
Obsoletes: %{_cross_os}%{gorepo} <= 1.7.15

systemd-252

Obsoletes: %{_cross_os}systemd

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

@piyush-jena piyush-jena marked this pull request as ready for review December 16, 2025 02:07
@piyush-jena piyush-jena force-pushed the create-aliases branch 2 times, most recently from 23b0c5d to 17ab017 Compare December 17, 2025 22:12
@piyush-jena piyush-jena force-pushed the create-aliases branch 2 times, most recently from 8403d9a to 81decb9 Compare December 18, 2025 09:05
Signed-off-by: Piyush Jena <jepiyush@amazon.com>
@piyush-jena
Copy link
Author

Updated the logic to accomodate the above comments. Testing corner cases are detailed in the description above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants