containers / common

Location for shared common files in github.com/containers repos.
Apache License 2.0
193 stars 201 forks source link

libimage tests: try to avoid docker.io images #2250

Closed Luap99 closed 5 days ago

Luap99 commented 5 days ago

These images can and will change at any time and thus can break our CI without any external changes which is very bad. The TestPush test is failing because it expects two not one image as it converts from docker to oci on push. However the upstream docker.io/library/alpine was switched to an oci image thus the test started failing as the local storage now has the same id and just stores two different tags for the same image.

Switch to our own controlled quay.io images where possible. This is neither complete nor do I fully understand the tests here. I did a quick search and replace and will see what works or not.

openshift-ci[bot] commented 5 days ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Luap99

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/containers/common/blob/main/OWNERS)~~ [Luap99] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
mheon commented 5 days ago

LGTM

Luap99 commented 5 days ago

@baude @rhatdan @mtrmac PTAL, needed to get CI passing again here

rhatdan commented 5 days ago

/lgtm

Luap99 commented 3 days ago

Note that the tests didn't pull from Docker Hub (see https://github.com/containers/common/blob/main/libimage/testdata/registries.conf). Was the GCR mirror playing funny things?

The commit message explains everything or was that not clear:

These images can and will change at any time and thus can break our CI without any external changes which is very bad. The TestPush test is failing because it expects two not one image as it converts from docker to oci on push. However the upstream docker.io/library/alpine was switched to an oci image thus the test started failing as the local storage now has the same id and just stores two different tags for the same image.

It doesn't matter what cache is used, any image not under our control WILL BREAK US one day when it gets updated (or removed). I would like to switch everything to quay.io/libpod but that seems much more complex as here there is some special docker.io handling around the name which cannot be changed without loosing the test coverage I guess so that needs a much longer investigation how to address that.

vrothberg commented 3 days ago

I think we could rewrite docker.io/library to our libpod repo. That will preserve the docker.io reference but pull images under our control. See https://github.com/containers/common/blob/main/tests/registries.conf#L12-L17 for example.