debian-forge-composer/internal/container
Christian Kellner 34c94ab92b container: rework GetDefaultAuthFile and don't cache its result
Instead of using a cached result `GetDefaultAuthFile`, always
do call the function when a new `Client` is created, since at
least `/run/containers` can get created as a side-effect by
one of the container. Now that we check eagerly and often the
path check function was reworked to only return paths that do
exist and are accessible.

Also check if `REGISTRY_AUTH_FILE` is set and if so, and it
is accessible use that.

To check accessability, use `unix.Access` instead of `os.Stat`,
since On Fedora/RHEL 9 `os.Stat` is implemented via `statx` and
will indeed return `EACCES` for inaccessible paths. But on RHEL
8 `lstat` is used and that will return `ENOENT` but then later
when trying to open the file we will get `EPERM`.
2022-07-26 17:07:31 +02:00
..
client.go container: rework GetDefaultAuthFile and don't cache its result 2022-07-26 17:07:31 +02:00
client_test.go container: add a check to ensure auth file path is always set 2022-07-26 17:07:31 +02:00
container_test.go container: add mock container registry for testing 2022-07-21 13:32:07 +02:00
resolver.go container: ability to set AuthFilePath for Resolver 2022-07-25 21:21:44 +02:00
resolver_test.go container: add tests for resolver 2022-07-21 13:32:07 +02:00
spec.go container: ability to resolve containers to specs 2022-07-21 13:32:07 +02:00