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": [...]
            },
            ...
        ]
    },
}

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