1
0
mirror of https://github.com/containers/buildah.git synced 2026-02-05 09:45:38 +01:00

only process path for types that need it

Signed-off-by: iTrooz <hey@itrooz.fr>
This commit is contained in:
iTrooz
2025-12-03 11:09:09 +01:00
committed by Nalin Dahyabhai
parent a96aff95b8
commit ad8478658a

View File

@@ -53,11 +53,17 @@ func NormalizePlatform(platform v1.Platform) v1.Platform {
// ExportFromReader reads bytes from given reader and exports to external tar, directory or stdout.
func ExportFromReader(input io.Reader, opts parse.BuildOutputOption) error {
var err error
if !filepath.IsAbs(opts.Path) {
if opts.Path, err = filepath.Abs(opts.Path); err != nil {
return err
// Only process path for types that require it.
if opts.Type == parse.BuildOutputLocalDir || opts.Type == parse.BuildOutputTar {
if !filepath.IsAbs(opts.Path) {
if opts.Path, err = filepath.Abs(opts.Path); err != nil {
return err
}
}
}
// Process output type
switch opts.Type {
case parse.BuildOutputLocalDir:
// In order to keep this feature as close as possible to