fix regression in rework of tools/oci/artifact_utils.py

I noticed this error in https://gitlab.com/sylva-projects/sylva-core/-/jobs/8676565964#L256:

2024-12-18 14:15:50,690 [INFO]   running: flux pull artifact oci://registry.gitlab.com/sylva-projects/sylva-core/kustomize-units:0.0.0-git-e986953a -o /tmp/sylva-pulled-v9ig68jx
2024-12-18 14:15:51,061 [WARNING]     !stderr: ► pulling artifact from registry.gitlab.com/sylva-projects/sylva-core/kustomize-units:0.0.0-git-e986953a
2024-12-18 14:15:51,061 [WARNING]     !stderr: ✔ source https://gitlab.com/sylva-projects/sylva-core.git
2024-12-18 14:15:51,062 [WARNING]     !stderr: ✔ revision /e986953
2024-12-18 14:15:51,062 [WARNING]     !stderr: 
2024-12-18 14:15:51,062 [WARNING]     !stderr: ✔ digest registry.gitlab.com/sylva-projects/sylva-core/kustomize-units@sha256:1c5248ef7cb13e724b01563ad10c35f0336fcd626d1f88700c5a907a18f7e708
2024-12-18 14:15:51,062 [WARNING]     !stderr: ✔ artifact content extracted to /tmp/sylva-pulled-v9ig68jx
Traceback (most recent call last):
  File "/builds/sylva-projects/sylva-core/tools/oci/build-kustomize-units-artifact.py", line 132, in <module>
    if artifact_exists_with_flux(artifact_name, artifact_version, artifact_url):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builds/sylva-projects/sylva-core/tools/oci/artifact_utils.py", line 211, in artifact_exists_with_flux
    ARTIFACT_DIGEST = re.search('.*@+(.*)', result.stdout, flags=re.M).group(1)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This must have been was introduced by !3494 (merged) although I don't get why the CI testing in that MR didn't catch it.... 🤔 ... ... CI testing didn't catch it because it occurs only on the second run of the script for a given commit...

Edited by Thomas Morin

Merge request reports

Loading