vendor: update c/{buildah,common,image,storage} to main

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
Paul Holzinger
2025-05-28 14:53:37 +02:00
parent e98e128012
commit b551939be6
123 changed files with 2454 additions and 1568 deletions

View File

@@ -5,14 +5,14 @@ import (
"github.com/pkg/errors"
)
// ErrorLocation gives a location in source code that caused the error
type ErrorLocation struct {
// LocationError gives a location in source code that caused the error
type LocationError struct {
Locations [][]Range
error
}
// Unwrap unwraps to the next error
func (e *ErrorLocation) Unwrap() error {
func (e *LocationError) Unwrap() error {
return e.error
}
@@ -45,7 +45,7 @@ func setLocation(err error, location []Range, add bool) error {
if err == nil {
return nil
}
var el *ErrorLocation
var el *LocationError
if errors.As(err, &el) {
if add {
el.Locations = append(el.Locations, location)
@@ -54,7 +54,7 @@ func setLocation(err error, location []Range, add bool) error {
}
return err
}
return stack.Enable(&ErrorLocation{
return stack.Enable(&LocationError{
error: err,
Locations: [][]Range{location},
})

View File

@@ -318,7 +318,7 @@ func parseMaybeJSON(rest string, d *directives) (*Node, map[string]bool, error)
if err == nil {
return node, attrs, nil
}
if err == errDockerfileNotStringArray {
if errors.Is(err, errDockerfileNotStringArray) {
return nil, nil, err
}
@@ -336,7 +336,7 @@ func parseMaybeJSONToList(rest string, d *directives) (*Node, map[string]bool, e
if err == nil {
return node, attrs, nil
}
if err == errDockerfileNotStringArray {
if errors.Is(err, errDockerfileNotStringArray) {
return nil, nil, err
}

View File

@@ -114,7 +114,7 @@ type Heredoc struct {
var (
dispatch map[string]func(string, *directives) (*Node, map[string]bool, error)
reWhitespace = regexp.MustCompile(`[\t\v\f\r ]+`)
reHeredoc = regexp.MustCompile(`^(\d*)<<(-?)([^<]*)$`)
reHeredoc = regexp.MustCompile(`^(\d*)<<(-?)\s*([^<]*)$`)
reLeadingTabs = regexp.MustCompile(`(?m)^\t+`)
)
@@ -556,8 +556,8 @@ func scanLines(data []byte, atEOF bool) (advance int, token []byte, err error) {
}
func handleScannerError(err error) error {
switch err {
case bufio.ErrTooLong:
switch {
case errors.Is(err, bufio.ErrTooLong):
return errors.Errorf("dockerfile line greater than max allowed size of %d", bufio.MaxScanTokenSize-1)
default:
return err