osism / openstack-image-manager

Easily manage and keep up to date a large number of images on an OpenStack environment
https://osism.tech/docs/guides/operations-guide/openstack/tools/image-manager/
Apache License 2.0
29 stars 19 forks source link

Naming scheme mismatch between openstack-image-manager and SCS standard #753

Closed markus-hentsch closed 7 months ago

markus-hentsch commented 7 months ago

The current implementation of assembling image names^1 in the openstack-image-manager puts a space character between name and version for non-multi images.

This seems in conflict with the image naming scheme currently mandated by SCS for the "ubuntu-capi-image"^2 where a hyphen is expected between name and version.

Consider the following example images.yaml as input (content shortened):

---
images:
  - name: Ubuntu 22.04
    enable: true
    shortname: ubuntu-22.04
    format: qcow2
    ...
    versions:
      - version: '20240319'
        url: https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64.img
        checksum: "sha256:304983616fcba6ee1452e9f38993d7d3b8a90e1eb65fb0054d672ce23294d812"
        build_date: 2024-03-19
  - name: ubuntu-capi-image
    enable: true
    format: qcow2
    ...
    tags: []
    versions:
      - version: 'v1.26.11'
        url: https://swift.services.a.regiocloud.tech/swift/v1/AUTH_b182637428444b9aa302bb8d5a5a418c/openstack-k8s-capi-images/ubuntu-2204-kube-v1.26/ubuntu-2204-kube-v1.26.11.qcow2
        checksum: "sha256:ccab58db9581977b1455a27445f7e7f7238ca2457f13464e0d00586dd1f96d6a"
        build_date: 2023-11-16

This leads to:

+--------------------------------------+----------------------------+--------+
| ID                                   | Name                       | Status |
+--------------------------------------+----------------------------+--------+
| 7b0f58a7-7506-4794-bc29-17ab4c7edd63 | Ubuntu 22.04               | active |
| b1d41496-d68a-4126-bd1a-5c4cc9a0d3dc | ubuntu-capi-image v1.26.11 | active |
+--------------------------------------+----------------------------+--------+

... and does not pass the SCS conformance check^3 as it fails to recognize the "ubuntu-capi-image":

python3 images-openstack.py --os-cloud devstack scs-0104-v1-images.yaml

INFO: Missing recommended image 'ubuntu-capi-image'
mbuechse commented 7 months ago

Apparently, we expect a dash where there's a space: ...image v1.26... should be ...image-v1.26...

mbuechse commented 7 months ago

@berendt I don't recall how we arrived at the name scheme, but I presume I had a look at some existing image. Has anything changed about the naming?

mbuechse commented 7 months ago

Thanks everyone. In my opinion, this is not a problem with the image manager, but a bug in the namescheme. As pointed out by @garloff in the Matrix channel, the space character is what the SCS image metadata standard suggests: https://docs.scs.community/standards/scs-0102-v1-image-metadata#naming So I will file a bug issue in the standards repo and fix it there.

EDIT: The bug issue I promised. Funny that its number (viewed as a decimal string) is a permutation of this issue's number!