mirror of
https://github.com/containers/podman.git
synced 2025-11-30 01:58:46 +08:00
vendor: update buildah to latest main
Includes one breaking change for the flag as BuildOutputs now accept a slice. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
4
vendor/github.com/openshift/imagebuilder/.travis.yml
generated
vendored
4
vendor/github.com/openshift/imagebuilder/.travis.yml
generated
vendored
@@ -25,8 +25,8 @@ before_install:
|
||||
- docker pull centos:7
|
||||
- docker pull alpine
|
||||
- docker pull registry.fedoraproject.org/fedora-minimal
|
||||
- docker pull registry.fedoraproject.org/fedora-minimal:41-x86_64
|
||||
- docker pull registry.fedoraproject.org/fedora-minimal:41-aarch64
|
||||
- docker pull registry.fedoraproject.org/fedora-minimal:42-x86_64
|
||||
- docker pull registry.fedoraproject.org/fedora-minimal:42-aarch64
|
||||
- chmod -R go-w ./dockerclient/testdata
|
||||
|
||||
script:
|
||||
|
||||
4
vendor/github.com/openshift/imagebuilder/README.md
generated
vendored
4
vendor/github.com/openshift/imagebuilder/README.md
generated
vendored
@@ -106,8 +106,8 @@ docker rmi busybox; docker pull busybox
|
||||
docker rmi alpine; docker pull alpine
|
||||
docker rmi centos:7; docker pull centos:7
|
||||
docker rmi registry.fedoraproject.org/fedora-minimal; docker pull registry.fedoraproject.org/fedora-minimal
|
||||
docker rmi registry.fedoraproject.org/fedora-minimal:41-x86_64; docker pull registry.fedoraproject.org/fedora-minimal:41-x86_64
|
||||
docker rmi registry.fedoraproject.org/fedora-minimal:41-aarch64; docker pull registry.fedoraproject.org/fedora-minimal:41-aarch64
|
||||
docker rmi registry.fedoraproject.org/fedora-minimal:42-x86_64; docker pull registry.fedoraproject.org/fedora-minimal:42-x86_64
|
||||
docker rmi registry.fedoraproject.org/fedora-minimal:42-aarch64; docker pull registry.fedoraproject.org/fedora-minimal:42-aarch64
|
||||
chmod -R go-w ./dockerclient/testdata
|
||||
go test ./dockerclient -tags conformance -timeout 30m
|
||||
```
|
||||
|
||||
63
vendor/github.com/openshift/imagebuilder/builder.go
generated
vendored
63
vendor/github.com/openshift/imagebuilder/builder.go
generated
vendored
@@ -2,6 +2,7 @@ package imagebuilder
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
@@ -9,6 +10,7 @@ import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"slices"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
@@ -288,6 +290,55 @@ type Stage struct {
|
||||
}
|
||||
|
||||
func NewStages(node *parser.Node, b *Builder) (Stages, error) {
|
||||
getStageFrom := func(stageIndex int, root *parser.Node) (from string, as string, err error) {
|
||||
for _, child := range root.Children {
|
||||
if !strings.EqualFold(child.Value, command.From) {
|
||||
continue
|
||||
}
|
||||
if child.Next == nil {
|
||||
return "", "", errors.New("FROM requires an argument")
|
||||
}
|
||||
if child.Next.Value == "" {
|
||||
return "", "", errors.New("FROM requires a non-empty argument")
|
||||
}
|
||||
from = child.Next.Value
|
||||
if name, ok := extractNameFromNode(child); ok {
|
||||
as = name
|
||||
}
|
||||
return from, as, nil
|
||||
}
|
||||
return "", "", fmt.Errorf("stage %d requires a FROM instruction (%q)", stageIndex+1, root.Original)
|
||||
}
|
||||
argInstructionsInStages := make(map[string][]string)
|
||||
setStageInheritedArgs := func(s *Stage) error {
|
||||
from, as, err := getStageFrom(s.Position, s.Node)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
inheritedArgs := argInstructionsInStages[from]
|
||||
thisStageArgs := slices.Clone(inheritedArgs)
|
||||
for _, child := range s.Node.Children {
|
||||
if !strings.EqualFold(child.Value, command.Arg) {
|
||||
continue
|
||||
}
|
||||
if child.Next == nil {
|
||||
return errors.New("ARG requires an argument")
|
||||
}
|
||||
if child.Next.Value == "" {
|
||||
return errors.New("ARG requires a non-empty argument")
|
||||
}
|
||||
next := child.Next
|
||||
for next != nil {
|
||||
thisStageArgs = append(thisStageArgs, next.Value)
|
||||
next = next.Next
|
||||
}
|
||||
}
|
||||
if as != "" {
|
||||
argInstructionsInStages[as] = thisStageArgs
|
||||
}
|
||||
argInstructionsInStages[strconv.Itoa(s.Position)] = thisStageArgs
|
||||
return arg(s.Builder, inheritedArgs, nil, nil, "", nil)
|
||||
}
|
||||
var stages Stages
|
||||
var headingArgs []string
|
||||
if err := b.extractHeadingArgsFromNode(node); err != nil {
|
||||
@@ -297,8 +348,8 @@ func NewStages(node *parser.Node, b *Builder) (Stages, error) {
|
||||
headingArgs = append(headingArgs, k)
|
||||
}
|
||||
for i, root := range SplitBy(node, command.From) {
|
||||
name, _ := extractNameFromNode(root.Children[0])
|
||||
if len(name) == 0 {
|
||||
name, hasName := extractNameFromNode(root.Children[0])
|
||||
if !hasName {
|
||||
name = strconv.Itoa(i)
|
||||
}
|
||||
filteredUserArgs := make(map[string]string)
|
||||
@@ -317,12 +368,16 @@ func NewStages(node *parser.Node, b *Builder) (Stages, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
stages = append(stages, Stage{
|
||||
stage := Stage{
|
||||
Position: i,
|
||||
Name: processedName,
|
||||
Builder: b.builderForStage(headingArgs),
|
||||
Node: root,
|
||||
})
|
||||
}
|
||||
if err := setStageInheritedArgs(&stage); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
stages = append(stages, stage)
|
||||
}
|
||||
return stages, nil
|
||||
}
|
||||
|
||||
2
vendor/github.com/openshift/imagebuilder/imagebuilder.spec
generated
vendored
2
vendor/github.com/openshift/imagebuilder/imagebuilder.spec
generated
vendored
@@ -12,7 +12,7 @@
|
||||
#
|
||||
|
||||
%global golang_version 1.19
|
||||
%{!?version: %global version 1.2.16-dev}
|
||||
%{!?version: %global version 1.2.16}
|
||||
%{!?release: %global release 1}
|
||||
%global package_name imagebuilder
|
||||
%global product_name Container Image Builder
|
||||
|
||||
Reference in New Issue
Block a user