Commit Graph

10 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 ca3b80eb0f CI: enable the whitespace linter
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2024-08-15 16:09:25 -04:00
Miloslav Trmač bdd27d3937 Add smoke tests for encryption CLI helpers
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2023-06-13 19:39:12 +02:00
Daniel J Walsh 6714a79eb0
Make cli.EncryptConfig,DecryptConfig, GetFormat public
We want to share these functions with Podman, Podman currently
has a slightly different version which is correct, so use correct
version in Buildah and vendor it into Podman.

Fixing: https://github.com/containers/podman/issues/18196

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-06-09 11:09:18 -04:00
Chris Bandy 2ad68d816f run: pass process environment variables by reference
See: https://github.com/containers/buildah/issues/4688
Signed-off-by: Chris Bandy <bandy.chris@gmail.com>
2023-04-02 18:19:37 -05:00
Paul Holzinger ea81614af3
pkg/cli: improve completion test
When we have a bool flag there is zero reason to define a completion
function since this flag takes no argument and the cobra lib will thus
not use it.

Podman checks that already and recently buildah caused the test to fail. [1]
To make sure this does not happen again we should have the same check here.

[1] https://github.com/containers/podman/pull/13808#issuecomment-1250318199

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-09-25 22:35:19 -04:00
Kirill Shirinkin 2d822034f8 Rename bud to build, while keeping an alias for to bud.
Signed-off-by: Kirill Shirinkin <kirill@hey.com>
2021-08-25 17:56:58 +02:00
Nalin Dahyabhai ae08e01e49 bud: teach --platform to take a list
Add a pkg/parse.PlatformsFromOptions() which understands a "variant"
value as an optional third value in an OS/ARCH[/VARIANT] argument value,
which accepts a comma-separated list of them, and which returns a list
of platforms.

Teach "from" and "pull" about the --platform option and add integration
tests for them, warning if --platform was given multiple values.

Add a define.BuildOptions.JobSemaphore which an imagebuildah executor
will use in preference to one that it might allocate for itself.

In main(), allocate a JobSemaphore if the number of jobs is not 0 (which
we treat as "unlimited", and continue to allow executors to do).

In addManifest(), take a lock on the manifest list's image ID so that we
don't overwrite changes that another thread might be making while we're
attempting to make changes to it.  In main(), create an empty list if
the list doesn't already exist before we start down this path, so that
we don't get two threads trying to create that manifest list at the same
time later on.  Two processes could still try to create the same list
twice, but it's an incremental improvement.

Finally, if we've been given multiple platforms to build for, run their
builds concurrently and gather up their results.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2021-08-04 15:23:10 -04:00
Paul Holzinger 71ba2e4ef0 Shell Completion for podman build flags
The PR containers/podman#6442 enables a new way to create
shell completions scripts. The shell completion is handled
by cobra and since the build flags are defined here
the completion functions for this should be defined here
as well. For Reference see:
https://github.com/spf13/cobra/blob/master/shell_completions.md

I added a unit test to ensure that the flags have a
completion function set.

These completions could also be used by buildah if someone
wants to implements this cobra completion logic for buildah.

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2020-10-01 17:45:43 +02:00