Skip to content

Commit f57a5bc

Browse files
committed
imagebuildah.stageExecutor.runStageMountPoints(): correct an error
Add a missing "not" to an error message. Signed-off-by: Nalin Dahyabhai <[email protected]>
1 parent 705ba3b commit f57a5bc

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

imagebuildah/stage_executor.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ func (s *stageExecutor) performCopy(excludes []string, copies ...imagebuilder.Co
454454
copy.Src = copySources
455455
}
456456

457-
if len(copy.From) > 0 && len(copy.Files) == 0 {
457+
if copy.From != "" && len(copy.Files) == 0 {
458458
// If from has an argument within it, resolve it to its
459459
// value. Otherwise just return the value found.
460460
from, fromErr := imagebuilder.ProcessWord(copy.From, s.stage.Builder.Arguments())
@@ -536,7 +536,8 @@ func (s *stageExecutor) performCopy(excludes []string, copies ...imagebuilder.Co
536536
}
537537
contextDir = mountPoint
538538
}
539-
// Original behaviour of buildah still stays true for COPY irrespective of additional context.
539+
// With --from set, the content being copied isn't coming from the default
540+
// build context directory, so we're not expected to force everything to 0:0
540541
preserveOwnership = true
541542
copyExcludes = excludes
542543
} else {
@@ -656,7 +657,7 @@ func (s *stageExecutor) runStageMountPoints(mountList []string) (map[string]inte
656657
if additionalBuildContext.IsImage {
657658
mountPoint, err := s.getImageRootfs(s.ctx, additionalBuildContext.Value)
658659
if err != nil {
659-
return nil, fmt.Errorf("%s from=%s: image found with that name", flag, from)
660+
return nil, fmt.Errorf("%s from=%s: image not found with that name", flag, from)
660661
}
661662
// The `from` in stageMountPoints should point
662663
// to `mountPoint` replaced from additional

0 commit comments

Comments
 (0)