Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #37887 - Add metadata fields to docker manifest lists #11172

Merged
merged 1 commit into from
Nov 4, 2024

Conversation

sjha4
Copy link
Member

@sjha4 sjha4 commented Oct 7, 2024

What are the changes introduced in this pull request?

Add metadata fields that were added to manifests to manifest labels as these fields are applicable to both.

Considerations taken when implementing this change?

This is similar to what we did before for manifests in Katello. #10975

What are the testing steps for this pull request?

  1. Check out this PR and run bundle exec rails db:migrate
  2. Create and sync a bootable or flatpak repo
  3. Check that the manifest lists that get created have their own fields set according to information in pulp.

Sync a container repo with labels/anotations.
ex: https://quay.io/repository/centos-bootc/fedora-bootc
tag: sha256-4b336aaec054e57549075517ae025a8c3b8b23703d928437dce6a1db068eae5a

Check the API , replace :ID :

https://centos8-katello-devel-stable.example.com/katello/api/v2/docker_manifest_lists?organization_id=1&page=1&paged=true&per_page=20&repository_id=:ID&search=

Copy link
Member

@ianballou ianballou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking great:

vagrant@potato ~/foreman $ curl https://`hostname`/katello/api/v2/docker_manifest_lists/4 -u admin:changeme | jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   827  100   827    0     0   3595      0 --:--:-- --:--:-- --:--:--  3595
{
  "id": 4,
  "schema_version": 2,
  "digest": "sha256:650b3c79307f5cff36bce3a59e928279e96b02e18e1aacb8b30f6916c477ab14",
  "manifest_type": "list",
  "annotations": {},
  "labels": {},
  "is_bootable": true,
  "is_flatpak": false,
  "tags": [
    {
      "id": 4,
      "repository_id": "centos-bootc",
      "name": "stream9"
    }
  ],
  "manifests": [
    {
      "id": 10,
      "digest": "sha256:893b636bbc5725378ce602f222f26c29f51334f93243ae8657d31391634eb024",
      "schema_version": 2,
      "manifest_type": "image"
    },
    {
      "id": 11,
      "digest": "sha256:5f10bccd5246ececc3fa1d8f3dc8726a1e3ac10a30da44764a988603c11a0d70",
      "schema_version": 2,
      "manifest_type": "image"
    },
    {
      "id": 12,
      "digest": "sha256:22bf1c634c1491d905febb0e4726d6fbdfb2f775be23c47f74406d4c10be7b2c",
      "schema_version": 2,
      "manifest_type": "image"
    },
    {
      "id": 13,
      "digest": "sha256:20684c7064db93d4a9710fb6935185fdb137f16754f01aee401ab498acbe153c",
      "schema_version": 2,
      "manifest_type": "image"
    }
  ]
}

One question: should we also update https://github.com/katello/katello/blob/master/lib/katello/tasks/repository.rake#L117 ?

We can make it start reindexing manifest lists as well.

Copy link
Member

@ianballou ianballou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@sjha4 sjha4 merged commit da40587 into Katello:master Nov 4, 2024
26 of 27 checks passed
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.

2 participants