Commit Graph

9 Commits

Author SHA1 Message Date
Jan Kaluza a0a9ac6380 Switch common, storage and image to monorepo.
Signed-off-by: Jan Kaluza <jkaluza@redhat.com>
2025-08-29 15:04:28 +02:00
flouthoc aadfc5cf30
unit_test: use Parallel test where possible
Add `t.Parallel()` to unit tests whereever its possible without race.

Signed-off-by: flouthoc <flouthoc.git@gmail.com>
2025-02-04 11:07:15 -08:00
Nalin Dahyabhai 025a8df513 util.SortMounts(): make the returned order more stable
Use sort.Stable() instead of sort.Sort() to sort mounts, and have the
comparison function compare the cleaned paths directly if they have the
same number of components, so that there's a defined ordering between
"/a" and "/b".

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2022-11-30 16:14:22 -05:00
Nalin Dahyabhai 491ad0270a Drop util/util.Cause()
Use errors.Is() and errors.As() instead of our own
call-errors.Unwrap()-over-and-over-again helper.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2022-08-18 09:58:45 -04:00
Sascha Grunert ce384684c0
Switch to golang native error wrapping
We now use the golang error wrapping format specifier `%w` instead of
the deprecated github.com/pkg/errors package.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2022-07-07 11:41:47 +02:00
Nalin Dahyabhai c6e2a5e87d Replace fmt.Sprintf("%d", x) with strconv.Itoa(x)
Replace calls to fmt.Sprintf("%d", x) with strconv.Itoa(x), which is
slightly faster.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2021-09-27 18:27:22 -04:00
Daniel J Walsh d29b04dba7
Sort all mounts by destination directory
Currently depending on the sort order of mount points, we can overmount
a volume specified from the user. Podman has a function sortMount that
sorts all mounts based on destination directory to ensure all mounts
show up. This PR moves the function from Podman to Buildah. Once merged
I will change Podman to use the buildah function.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-03-31 16:26:09 -04:00
Daniel J Walsh f4424ca9e8
Pick default OCI Runtime from containers.conf
Currently we have a weird situation where the user sets the default
runtime in his containers.conf for podman but Buildah is still falling
back to use runc because it was hard coded as the default for Buildah.

I would like to remove this default, but that would theoretically break
the API promise of Buildah.

This should fix https://github.com/containers/podman/issues/8893

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-01-22 07:31:23 -05:00
Nalin Dahyabhai abda6f3156 Deduplicate environment variables
When combining lists of environment variables, or environment variables
combined with build arguments, always deduplicate sets of values.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2020-07-13 18:09:57 -04:00