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

Pushing multiple container images clobbers build metadata values #1099

Open
jlebon opened this issue Feb 28, 2025 · 3 comments
Open

Pushing multiple container images clobbers build metadata values #1099

jlebon opened this issue Feb 28, 2025 · 3 comments
Labels
jira For syncing to JIRA

Comments

@jlebon
Copy link
Member

jlebon commented Feb 28, 2025

Right now in OCP we're pushing the rhel-9.6 image to both Quay.io and registry.ci using the new capabilities added in #1091. The problem is that the cosa schema only supports specifying a single pushed repository. But ideally we include all of them and not just the last one in the list (which is what currently happens).

The relevant part of the schema is here: https://github.com/coreos/coreos-assembler/blob/837190dffb5d5cc56b9815ff937a6196eeb4205e/src/v1.json#L50-L87.

I think probably the cleanest, even though it's still awkward, is to add a primary-image object to the schema which sources the image object's properties, but also adds a new additional-images property. This property is then a list type of image objects.

And then in cosa push-container-manifest, if the primary object already exists for the image we're pushing, add it to the additional-images list in that object instead.

@jbtrystram
Copy link
Contributor

Why not simply make oscontainer and the others an array ? I don't see what a primary and additional adds, as they are all the same images ?

@jbtrystram
Copy link
Contributor

e.g.

diff --git a/src/v1.json b/src/v1.json
index f7d75843b..c9ec2d645 100644
--- a/src/v1.json
+++ b/src/v1.json
@@ -700,7 +700,7 @@
     },
     "oscontainer": {
       "$id": "#/properties/oscontainer",
-      "type": "object",
+      "type": "array",
       "title": "Oscontainer",
       "$ref": "#/definitions/image"
     },
@@ -919,7 +919,7 @@
     },
     "base-oscontainer": {
       "$id": "#/properties/base-oscontainer",
-      "type": "object",
+      "type": "array",
       "title": "Base OS container",
       "$ref": "#/definitions/image"
     },

@jlebon
Copy link
Member Author

jlebon commented Mar 5, 2025

Unfortunately, we can't change existing types because it would render existing meta.jsons invalid. We'd have to do a schema version bump, which doesn't seem worth it.

Putting my proposal in JSON:

{
    ...
    "base-oscontainer": {
        "image": "...",
        "digest": "...",
        "tags": [...],
        "additional-images": [
            {
                "image": "...",
                "digest": "...",
                "tags": [...]
            },
            ...
        ]
    },
}

jbtrystram added a commit to jbtrystram/coreos-assembler that referenced this issue Mar 11, 2025
in coreos/fedora-coreos-pipeline#1091 we started
publishing container images in multiples repos.
However the build.json was not reflecting that, only storing the last
pushed image data, overwriting it with each arch.

See coreos#4038
See coreos/fedora-coreos-pipeline#1099
jbtrystram added a commit to jbtrystram/coreos-assembler that referenced this issue Mar 14, 2025
in coreos/fedora-coreos-pipeline#1091 we started
publishing container images in multiples repos.
However the build.json was not reflecting that, only storing the last
pushed image data, overwriting it with each arch.

See coreos#4038
See coreos/fedora-coreos-pipeline#1099
jbtrystram added a commit to jbtrystram/coreos-assembler that referenced this issue Mar 14, 2025
in coreos/fedora-coreos-pipeline#1091 we started
publishing container images in multiples repos.
However the build.json was not reflecting that, only storing the last
pushed image data, overwriting it with each arch.

See coreos#4038
See coreos/fedora-coreos-pipeline#1099
jbtrystram added a commit to jbtrystram/coreos-assembler that referenced this issue Mar 14, 2025
in coreos/fedora-coreos-pipeline#1091 we started
publishing container images in multiples repos.
However the build.json was not reflecting that, only storing the last
pushed image data, overwriting it with each arch.

See coreos#4038
See coreos/fedora-coreos-pipeline#1099
jbtrystram added a commit to jbtrystram/coreos-assembler that referenced this issue Mar 17, 2025
In coreos/fedora-coreos-pipeline#1091 we added
the possibility of publishing container images to multiples repositories.

This needs to be reflected in the schema otherwhise we only record one
image (currenlty the last pushed).

Add a `primary-image` key that extends image by adding an `additional-images`
array.

Use that for relevant container images objects.

See coreos/fedora-coreos-pipeline#1099
jbtrystram added a commit to jbtrystram/coreos-assembler that referenced this issue Mar 17, 2025
in coreos/fedora-coreos-pipeline#1091 we started
publishing container images in multiples repos.
However the build.json was not reflecting that, only storing the last
pushed image data, overwriting it with each arch.

See coreos#4038
See coreos/fedora-coreos-pipeline#1099
jbtrystram added a commit to jbtrystram/coreos-assembler that referenced this issue Mar 17, 2025
in coreos/fedora-coreos-pipeline#1091 we started
publishing container images in multiples repos.
However the build.json was not reflecting that, only storing the last
pushed image data, overwriting it with each arch.

See coreos#4038
See coreos/fedora-coreos-pipeline#1099
jbtrystram added a commit to jbtrystram/coreos-assembler that referenced this issue Mar 17, 2025
in coreos/fedora-coreos-pipeline#1091 we started
publishing container images in multiples repos.
However the build.json was not reflecting that, only storing the last
pushed image data, overwriting it with each arch.

See coreos#4038
See coreos/fedora-coreos-pipeline#1099
jbtrystram added a commit to jbtrystram/coreos-assembler that referenced this issue Mar 20, 2025
in coreos/fedora-coreos-pipeline#1091 we started
publishing container images in multiples repos.
However the build.json was not reflecting that, only storing the last
pushed image data, overwriting it with each arch.

See coreos#4038
See coreos/fedora-coreos-pipeline#1099
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
jira For syncing to JIRA
Projects
None yet
Development

No branches or pull requests

2 participants