mirror of
https://github.com/containers/podman.git
synced 2025-12-08 23:00:23 +08:00
[NO TESTS NEEDED] Vendor in containers/buildah v1.20.0
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
25
vendor/github.com/containers/buildah/imagebuildah/executor.go
generated
vendored
25
vendor/github.com/containers/buildah/imagebuildah/executor.go
generated
vendored
@@ -13,6 +13,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/containers/buildah"
|
||||
"github.com/containers/buildah/define"
|
||||
"github.com/containers/buildah/pkg/parse"
|
||||
"github.com/containers/buildah/util"
|
||||
"github.com/containers/common/pkg/config"
|
||||
@@ -56,7 +57,7 @@ type Executor struct {
|
||||
stages map[string]*StageExecutor
|
||||
store storage.Store
|
||||
contextDir string
|
||||
pullPolicy buildah.PullPolicy
|
||||
pullPolicy define.PullPolicy
|
||||
registry string
|
||||
ignoreUnrecognizedInstructions bool
|
||||
quiet bool
|
||||
@@ -74,13 +75,13 @@ type Executor struct {
|
||||
signaturePolicyPath string
|
||||
systemContext *types.SystemContext
|
||||
reportWriter io.Writer
|
||||
isolation buildah.Isolation
|
||||
namespaceOptions []buildah.NamespaceOption
|
||||
configureNetwork buildah.NetworkConfigurationPolicy
|
||||
isolation define.Isolation
|
||||
namespaceOptions []define.NamespaceOption
|
||||
configureNetwork define.NetworkConfigurationPolicy
|
||||
cniPluginPath string
|
||||
cniConfigDir string
|
||||
idmappingOptions *buildah.IDMappingOptions
|
||||
commonBuildOptions *buildah.CommonBuildOptions
|
||||
idmappingOptions *define.IDMappingOptions
|
||||
commonBuildOptions *define.CommonBuildOptions
|
||||
defaultMountsFilePath string
|
||||
iidfile string
|
||||
squash bool
|
||||
@@ -98,7 +99,7 @@ type Executor struct {
|
||||
excludes []string
|
||||
unusedArgs map[string]struct{}
|
||||
capabilities []string
|
||||
devices buildah.ContainerDevices
|
||||
devices define.ContainerDevices
|
||||
signBy string
|
||||
architecture string
|
||||
timestamp *time.Time
|
||||
@@ -126,7 +127,7 @@ type imageTypeAndHistoryAndDiffIDs struct {
|
||||
}
|
||||
|
||||
// NewExecutor creates a new instance of the imagebuilder.Executor interface.
|
||||
func NewExecutor(store storage.Store, options BuildOptions, mainNode *parser.Node) (*Executor, error) {
|
||||
func NewExecutor(store storage.Store, options define.BuildOptions, mainNode *parser.Node) (*Executor, error) {
|
||||
defaultContainerConfig, err := config.Default()
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(err, "failed to get container config")
|
||||
@@ -144,7 +145,7 @@ func NewExecutor(store storage.Store, options BuildOptions, mainNode *parser.Nod
|
||||
return nil, err
|
||||
}
|
||||
|
||||
devices := buildah.ContainerDevices{}
|
||||
devices := define.ContainerDevices{}
|
||||
for _, device := range append(defaultContainerConfig.Containers.Devices, options.Devices...) {
|
||||
dev, err := parse.DeviceFromPath(device)
|
||||
if err != nil {
|
||||
@@ -419,7 +420,8 @@ func (b *Executor) buildStage(ctx context.Context, cleanupStages map[int]*StageE
|
||||
// build and b.forceRmIntermediateCtrs is set, make sure we
|
||||
// remove the intermediate/build containers, regardless of
|
||||
// whether or not the stage's build fails.
|
||||
if b.forceRmIntermediateCtrs || !b.layers {
|
||||
// Skip cleanup if the stage has no instructions.
|
||||
if b.forceRmIntermediateCtrs || !b.layers && len(stage.Node.Children) > 0 {
|
||||
b.stagesLock.Lock()
|
||||
cleanupStages[stage.Position] = stageExecutor
|
||||
b.stagesLock.Unlock()
|
||||
@@ -433,7 +435,8 @@ func (b *Executor) buildStage(ctx context.Context, cleanupStages map[int]*StageE
|
||||
// The stage succeeded, so remove its build container if we're
|
||||
// told to delete successful intermediate/build containers for
|
||||
// multi-layered builds.
|
||||
if b.removeIntermediateCtrs {
|
||||
// Skip cleanup if the stage has no instructions.
|
||||
if b.removeIntermediateCtrs && len(stage.Node.Children) > 0 {
|
||||
b.stagesLock.Lock()
|
||||
cleanupStages[stage.Position] = stageExecutor
|
||||
b.stagesLock.Unlock()
|
||||
|
||||
Reference in New Issue
Block a user