Commit Graph

8 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
Nalin Dahyabhai 8ae99121c1 CI: enable the gofumpt linter
Turn on the gofumpt linter.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2024-08-15 13:17:44 -04:00
Giuseppe Scrivano 8bdd6a66d4
internal: use fileutils.(Le|E)xists
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-04-12 09:58:14 +02:00
Philip Dubé 53c65dd360 Replace strings.SplitN with strings.Cut
Introduced in go 1.18: https://github.com/golang/go/issues/46336

[NO NEW TESTS NEEDED]

Signed-off-by: Philip Dubé <philip@peerdb.io>
2024-01-02 17:15:12 +00:00
Chris Evich 46eea31588
Replace io/ioutil calls with os calls
In golang 1.19, `io/ioutil` is fully deprecated preventing Buildah from
compiling.  Replace all calls with equivalent calls from the `os`
package.

Signed-off-by: Chris Evich <cevich@redhat.com>
2022-12-06 14:29:32 -05:00
Daniel J Walsh 8d5d763213
Fix stutters
Podman adds an Error: to every error message. So starting an error
message with "error" ends up being reported to the user as

Error: error ...

This patch removes the stutter.

Also ioutil.ReadFile errors report the Path, so wrapping the err message
with the path causes a stutter.

Signed-off-by: Daniel J Walsh dwalsh@redhat.com

[NO NEW TESTS NEEDED]

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-09-19 07:11:44 -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
Valentin Rothberg 8696bfc7ad buildah source - create and manage source images
Add new `buildah source {create,add,push,pull}` commands.  All commands
are marked as experimental.  None of it is meant to be officially
supported at the time of writing.  All code resides in `internal/source`
and is hence not visible to external consumers of Buildah; just to be
on the safe side.

A source container or source image is an OCI artifact, that is an OCI
image with custom config (media type).  There is a longer history behind
source images which are intended to ship the source artifacts of an
ordinary "executable" container image.  Until now, source images at
Red Hat are built with github.com/containers/BuildSourceImage.  We had a
growing desire (and always the long-term plan) to eventually replace
BuildSurceImage with something else, in this case Buildah.

This commit adds the initial base functionality along with tests to make
sure we're not regressing.  The new commands do the following:

* `create` - creates an empty and initialized source image
* `add` - tar up a local path and add it as a layer to the souce image
* `push/pull` - intentionally separate commands from `buildah push/pull`
                to allow for an easier usage and prevent the
                implementations from undesired (future) interference

Further note: also vendor in c/image@master which ships a required fix.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-07-13 13:48:48 +02:00