Skip to content
This repository was archived by the owner on Dec 16, 2025. It is now read-only.
This repository was archived by the owner on Dec 16, 2025. It is now read-only.

Images miss SCS metadata #223

Closed
Closed

Description

@garloff

/kind bug

The CSPO registers missing node images which is nice.
However, these node images do not carry the metadata that we want all (public) images to have on SCS environments.
(We can ignore the naming RECOMMENDATION, but not the required properties, IMVHO.)

See SCS-v0102 for the wanted metadata.
We should have something like:
architecture='x86_64'
hw_disk_bus='scsi', hw_rng_model='virtio', hw_scsi_model='virtio-scsi'
hypervisor_type='qemu'
image_build_date='20XX-YY-ZZ'
image_description='Ubuntu 22.04 node image for capo'
image_original_user='ubuntu'
image_source='https://minio.services.osism.tech/openstack-k8s-capi-images/ .....' (please insert correct location!)
provided_until='20AA-BB-CC' (should be build date plus 14m)
replace_frequency='never'
uuid_validity='20AA-BB-CC'

The hw_disk_bus settings are merely a recommendation, but they will help @Nils98Ar ...

Activity

  1. added
    Container
    on Jan 13, 2025
  2. jschoone commented on Jan 13, 2025

    @jschoone
    Contributor

    Right, the properties are missing in the CRD. Should be added as a map to make it possible to add them to the node image config like this:

      createOpts:
        container_format: bare
        disk_format: qcow2
        name: ubuntu-capi-image-v1.29.12
        visibility: private
        properties:
          hw_disk_bus: "scsi"
          hw_rng_model: "virtio"
          hw_scsi_model: "virtio-scsi"
  3. Nils98Ar commented on Jan 14, 2025

    @Nils98Ar
    Member
  4. self-assigned this
    on Jan 14, 2025
  5. matofeder commented on Jan 15, 2025

    @matofeder
    Member

    I am not sure but I think we propably need to add the properties flat without a properties node in the yaml: https://github.com/gophercloud/gophercloud/blob/5770765aa037e1572cbaa9474113010a1397e822/openstack/image/v2/images/testing/fixtures_test.go#L25-L50

    +1 for the above

    Gophercloud drops Properties field when marshaling/unmarshaling JSON, see here and notice the json:"-".

    CSPO uses an image import call to import the image.
    In the case of the import image method, Glance's first step is to create an image record using the image create API call.
    And finally, the create image call doc mention the following:

    Additionally, you may include additional properties specified as key:value pairs, where the value must be a string data type. Keys are limited to 255 chars in length. Available key names may be limited by the cloud’s property protection configuration and reserved namespaces like os_glance.

    IMO It means that the flat structure proposed by @Nils98Ar should work.

  6. matofeder commented on Jan 16, 2025

    @matofeder
    Member

    I am not sure but I think we propably need to add the properties flat without a properties node in the yaml: https://github.com/gophercloud/gophercloud/blob/5770765aa037e1572cbaa9474113010a1397e822/openstack/image/v2/images/testing/fixtures_test.go#L25-L50

    +1 for the above

    Gophercloud drops Properties field when marshaling/unmarshaling JSON, see here and notice the json:"-".

    CSPO uses an image import call to import the image. In the case of the import image method, Glance's first step is to create an image record using the image create API call. And finally, the create image call doc mention the following:

    Additionally, you may include additional properties specified as key:value pairs, where the value must be a string data type. Keys are limited to 255 chars in length. Available key names may be limited by the cloud’s property protection configuration and reserved namespaces like os_glance.

    IMO It means that the flat structure proposed by @Nils98Ar should work.

    After tests and searching around, I can confirm that Properties is not passed to the image import process and all properties (defined flat or not) are dropped. The initial JSON unmarshalling in CSPO caused this.

    see also a related issue here: SovereignCloudStack/cluster-stacks#23, and comment SovereignCloudStack/cluster-stacks#23 (comment)

  7. Nils98Ar commented on Jan 16, 2025

    @Nils98Ar
    Member

    So json:"-" means "hide" and not "flat"?

  8. matofeder commented on Jan 16, 2025

    @matofeder
    Member

    So json:"-" means "hide" and not "flat"?

    The field is ignored when marshaling/unmarshaling. https://go.dev/play/p/YrzOmK1uUGg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Container

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions