spiegel_podman/pkg/api/handlers/compat
Valentin Rothberg 5bdd571b1e compat API: allow enforcing short-names resolution to Docker Hub
The Docker-compatible REST API has historically behaved just as the rest
of Podman and Buildah (and the atomic Docker in older RHEL/Fedora) where
`containers-registries.conf` is centrally controlling which registries
a short name may resolve to during pull or local image lookups.  Please
refer to a blog for more details [1].

Docker, however, is only resolving short names to docker.io which has
been reported (see #12320) to break certain clients who rely on this
behavior.  In order to support this scenario, `containers.conf(5)`
received a new option to control whether Podman's compat API resolves
to docker.io only or behaves as before.

Most endpoints allow for directly normalizing parameters that represent
an image.  If set in containers.conf, Podman will then normalize the
references directly to docker.io.  The build endpoint is an outlier
since images are also referenced in Dockerfiles.  The Buildah API,
however, supports specifying a custom `types.SystemContext` in which
we can set a field that enforces short-name resolution to docker.io
in `c/image/pkg/shortnames`.

Notice that this a "hybrid" approach of doing the normalization directly
in the compat endpoints *and* in `pkg/shortnames` by passing a system
context.  Doing such a hybrid approach is neccessary since the compat
and the libpod endpoints share the same `libimage.Runtime` which makes
a global enforcement via the `libimage.Runtime.systemContext`
impossible.  Having two separate runtimes for the compat and the libpod
endpoints seems risky and not generally applicable to all endpoints.

[1] https://www.redhat.com/sysadmin/container-image-short-names

Fixes: #12320
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-11-30 14:22:52 +01:00
..
auth.go Fix /auth compat endpoint 2021-09-15 20:01:02 +02:00
changes.go Refacter API server emphasis on logging 2021-09-10 15:07:25 -07:00
containers.go Add --time out for podman * rm -f commands 2021-10-04 07:07:56 -04:00
containers_archive.go fix: error reporting for archive endpoint 2021-11-28 19:02:15 +01:00
containers_attach.go Refacter API server emphasis on logging 2021-09-10 15:07:25 -07:00
containers_create.go compat API: allow enforcing short-names resolution to Docker Hub 2021-11-30 14:22:52 +01:00
containers_export.go Refacter API server emphasis on logging 2021-09-10 15:07:25 -07:00
containers_logs.go Refacter API server emphasis on logging 2021-09-10 15:07:25 -07:00
containers_pause.go Refacter API server emphasis on logging 2021-09-10 15:07:25 -07:00
containers_prune.go Refacter API server emphasis on logging 2021-09-10 15:07:25 -07:00
containers_restart.go Refacter API server emphasis on logging 2021-09-10 15:07:25 -07:00
containers_start.go standardize logrus messages to upper case 2021-09-22 15:29:34 -04:00
containers_stats.go standardize logrus messages to upper case 2021-09-22 15:29:34 -04:00
containers_stop.go Refacter API server emphasis on logging 2021-09-10 15:07:25 -07:00
containers_top.go Implement top streaming for containers and pods 2021-11-02 08:11:14 -07:00
containers_unpause.go Refacter API server emphasis on logging 2021-09-10 15:07:25 -07:00
events.go standardize logrus messages to upper case 2021-09-22 15:29:34 -04:00
exec.go Do not store the exit command in container config 2021-11-18 20:28:03 +01:00
images.go compat API: allow enforcing short-names resolution to Docker Hub 2021-11-30 14:22:52 +01:00
images_build.go compat API: allow enforcing short-names resolution to Docker Hub 2021-11-30 14:22:52 +01:00
images_history.go compat API: allow enforcing short-names resolution to Docker Hub 2021-11-30 14:22:52 +01:00
images_prune.go Refacter API server emphasis on logging 2021-09-10 15:07:25 -07:00
images_push.go compat API: allow enforcing short-names resolution to Docker Hub 2021-11-30 14:22:52 +01:00
images_remove.go compat API: allow enforcing short-names resolution to Docker Hub 2021-11-30 14:22:52 +01:00
images_save.go Refactor handler packages 2020-03-10 08:03:41 -07:00
images_search.go Refactor podman search to be more code friendly 2021-10-12 09:30:40 -07:00
images_tag.go compat API: allow enforcing short-names resolution to Docker Hub 2021-11-30 14:22:52 +01:00
info.go Refacter API server emphasis on logging 2021-09-10 15:07:25 -07:00
networks.go compat: Add subnet mask behind IP address to match Docker API 2021-11-20 21:00:38 +08:00
ping.go Refacter API server emphasis on logging 2021-09-10 15:07:25 -07:00
resize.go Refacter API server emphasis on logging 2021-09-10 15:07:25 -07:00
secrets.go Refacter API server emphasis on logging 2021-09-10 15:07:25 -07:00
swagger.go [NO TESTS NEEDED] Clean up swagger 2021-08-19 07:57:54 -07:00
system.go Refacter API server emphasis on logging 2021-09-10 15:07:25 -07:00
types.go V2 verify JSON output is consistent and doesn't drift 2020-05-28 16:20:29 -07:00
unsupported.go bump go module to v3 2021-02-22 09:03:51 +01:00
version.go Refacter API server emphasis on logging 2021-09-10 15:07:25 -07:00
volumes.go Add --time out for podman * rm -f commands 2021-10-04 07:07:56 -04:00