push-images-to-glance.py uses HTTP when insecure mode is asked

I noticed this failure in !1433 (merged):

2024-01-31 13:36:18,086 INFO __main__ <module>: Unzipping artifact...
Traceback (most recent call last):
  File "/opt/scripts/push-images-to-glance.py", line 164, in <module>
    unzipped_image = unzip_artifact(oras_pull_path)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/scripts/push-images-to-glance.py", line 46, in unzip_artifact
    if not os.path.exists(file_path):
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen genericpath>", line 19, in exists
TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType
==== END logs for container oci-tools-container of pod sylva-system/get-openstack-images-wx4r6 ====

Full logs at https://gitlab.com/sylva-projects/sylva-core/-/jobs/6062616174/artifacts/external_file/bootstrap-cluster-dump/sylva-system/get-openstack-images-8dh6r/logs.txt

EDIT:

the actual issue is :

2024-01-31 13:33:27,587 INFO __main__ <module>: Pulling image: ubuntu-jammy-plain-kubeadm-1-26-9 from artifact uri: oci://172.20.129.142/sylva-projects/sylva-elements/diskimage-builder/ubuntu-jammy-plain-kubeadm-1.26.9:0.1.7
2024-01-31 13:33:42,621 ERROR oras.logger text_handler: manifest unknown

and is due to the fact that we were using the ORAS_INSECURE_CLIENT flag, which didn't trigger the expected behavior from the oras-py libray (same option name in oras-py lib and the oras CLI don't give same behavior), we were hence unintendedly using a registry mirror with plain HTTP, which it wasn't supporting

/cc @mihai.zaharia

Edited Jan 31, 2024 by Thomas Morin
Assignee Loading
Time tracking Loading