Skip to content

Fix public_image_exist? template spec helper

What does this MR do and why?

We to explicitly tell the server which type of manifests it is looking for.

This is causing failures on !102893 (merged), because the updated image uses a different manifest format. The response error message is OCI index found, but accept header does not support OCI indexes.

Also updated the code to raise errors on unexpected response statuses to make debugging easier.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

How to set up and validate locally

Try running this against the changes in !102893 (merged) and verify that it fixes the problem. More precisely, try changing AUTO_BUILD_IMAGE_VERSION in lib/gitlab/ci/templates/Jobs/Build.gitlab-ci.yml to v1.28.0 and run:

bin/rspec ./spec/lib/gitlab/ci/templates/Jobs/build_gitlab_ci_yaml_spec.rb:11

Without these changes, it fails. With these changes, it succeeds.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Hordur Freyr Yngvason

Merge request reports

Loading