Also includes unreleased https://github.com/openshift/imagebuilder/pull/246 to work
with the updated docker/docker dependency.

And updates some references to newly deprecated docker/docker symbols.

[NO NEW TESTS NEEDED]

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
This commit is contained in:
Miloslav Trmač
2023-01-25 19:22:41 +01:00
parent 83f2f840e4
commit e308ba0215
292 changed files with 7975 additions and 5113 deletions

View File

@ -136,7 +136,7 @@ func label(b *Builder, args []string, attributes map[string]bool, flagArgs []str
//
func add(b *Builder, args []string, attributes map[string]bool, flagArgs []string, original string) error {
if len(args) < 2 {
return errAtLeastOneArgument("ADD")
return errAtLeastTwoArgument("ADD")
}
var chown string
var chmod string
@ -177,7 +177,7 @@ func add(b *Builder, args []string, attributes map[string]bool, flagArgs []strin
//
func dispatchCopy(b *Builder, args []string, attributes map[string]bool, flagArgs []string, original string) error {
if len(args) < 2 {
return errAtLeastOneArgument("COPY")
return errAtLeastTwoArgument("COPY")
}
last := len(args) - 1
dest := makeAbsolute(args[last], b.RunConfig.WorkingDir)
@ -704,6 +704,10 @@ func errAtLeastOneArgument(command string) error {
return fmt.Errorf("%s requires at least one argument", command)
}
func errAtLeastTwoArgument(command string) error {
return fmt.Errorf("%s requires at least two arguments", command)
}
func errExactlyOneArgument(command string) error {
return fmt.Errorf("%s requires exactly one argument", command)
}

View File

@ -12,8 +12,8 @@ import (
"strings"
"unicode"
"github.com/docker/docker/pkg/system"
"github.com/openshift/imagebuilder/dockerfile/command"
"github.com/containers/storage/pkg/system"
"github.com/pkg/errors"
)