crc-org / snc

Single Node Cluster creation scripts for OpenShift 4.x as used by CodeReady Containers
https://crc.dev
Apache License 2.0
100 stars 50 forks source link

Add bundle version label to container image script #567

Open praveenkumar opened 2 years ago

praveenkumar commented 2 years ago

We should have a way to identify which bundle version is part of a container image without pulling it and one way to do it to add label to it so that with skopeo inspect --no-tags docker://quay.io/crcont/podman-bundle:2.7.1 provide us this info.

Currently we get following

$ skopeo inspect --no-tags docker://quay.io/crcont/podman-bundle:2.7.1
{
    "Name": "quay.io/crcont/podman-bundle",
    "Digest": "sha256:95f37c68aff4ecc371e718f6a1eb962ede0c9f93ebba715180484ea06180886d",
    "RepoTags": [],
    "Created": "2022-07-27T09:37:45.9962813Z",
    "DockerVersion": "",
    "Labels": {
        "io.buildah.version": "1.24.1"
    },
    "Architecture": "amd64",
    "Os": "linux",
    "Layers": [
        "sha256:7f38c0640dd2dbfeed00441283cc2c90579e3c1c3d910e2b00c7493e32c3189c"
    ],
    "Env": [
        "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
    ]
}
cfergeau commented 2 years ago

Having bundle type (podman, okd, ...) as a label will also be useful.

praveenkumar commented 2 years ago

Having bundle type (podman, okd, ...) as a label will also be useful.

@cfergeau is there any use of those currently or just to have as part of metadata?

cfergeau commented 2 years ago

Having bundle type (podman, okd, ...) as a label will also be useful.

@cfergeau is there any use of those currently or just to have as part of metadata?

The idea was to be able to support docker://quay.io/myorg/my-bundle:2.7.1 and to be able to build the bundle path/name (`crc_podman_libvirt_4.1.1) from this URL. However, version/bundle type is being addressed differently in https://github.com/code-ready/snc/pull/569 if I understand correctly?

praveenkumar commented 2 years ago

Having bundle type (podman, okd, ...) as a label will also be useful.

@cfergeau is there any use of those currently or just to have as part of metadata?

The idea was to be able to support docker://quay.io/myorg/my-bundle:2.7.1 and to be able to build the bundle path/name (`crc_podman_libvirt_4.1.1) from this URL. However, version/bundle type is being addressed differently in #569 if I understand correctly?

@cfergeau Right, when I was trying to implement it, I observe it is better to just add the bundle name as it is because this we can then directly match with bundle path/name instead creating this details from 2-3 different metadata values (bundle-type, version, hypervisor ..etc.)