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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user