Skip to content

Commit

Permalink
[NO TESTS NEEDED] Vendor in containers/buildah v1.20.0
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
  • Loading branch information
rhatdan committed Mar 26, 2021
1 parent fa6ba9b commit 6fdc254
Show file tree
Hide file tree
Showing 158 changed files with 3,925 additions and 1,948 deletions.
18 changes: 9 additions & 9 deletions cmd/podman/images/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"time"

"github.com/containers/buildah"
"github.com/containers/buildah/imagebuildah"
"github.com/containers/buildah/define"
buildahCLI "github.com/containers/buildah/pkg/cli"
"github.com/containers/buildah/pkg/parse"
"github.com/containers/common/pkg/completion"
Expand Down Expand Up @@ -196,7 +196,7 @@ func build(cmd *cobra.Command, args []string) error {
var contextDir string
if len(args) > 0 {
// The context directory could be a URL. Try to handle that.
tempDir, subDir, err := imagebuildah.TempDirForURL("", "buildah", args[0])
tempDir, subDir, err := define.TempDirForURL("", "buildah", args[0])
if err != nil {
return errors.Wrapf(err, "error prepping temporary context directory")
}
Expand Down Expand Up @@ -304,16 +304,16 @@ func buildFlagsWrapperToOptions(c *cobra.Command, contextDir string, flags *buil
return nil, err
}

pullPolicy := imagebuildah.PullIfMissing
pullPolicy := define.PullIfMissing
if c.Flags().Changed("pull") && flags.Pull {
pullPolicy = imagebuildah.PullAlways
pullPolicy = define.PullAlways
}
if flags.PullAlways {
pullPolicy = imagebuildah.PullAlways
pullPolicy = define.PullAlways
}

if flags.PullNever {
pullPolicy = imagebuildah.PullIfMissing
pullPolicy = define.PullIfMissing
}

args := make(map[string]string)
Expand Down Expand Up @@ -388,9 +388,9 @@ func buildFlagsWrapperToOptions(c *cobra.Command, contextDir string, flags *buil
flags.Layers = false
}

compression := imagebuildah.Gzip
compression := define.Gzip
if flags.DisableCompression {
compression = imagebuildah.Uncompressed
compression = define.Uncompressed
}

isolation, err := parse.IsolationOption(flags.Isolation)
Expand Down Expand Up @@ -443,7 +443,7 @@ func buildFlagsWrapperToOptions(c *cobra.Command, contextDir string, flags *buil
return nil, errors.Wrapf(err, "unable to obtain decrypt config")
}

opts := imagebuildah.BuildOptions{
opts := define.BuildOptions{
AddCapabilities: flags.CapAdd,
AdditionalTags: tags,
Annotations: flags.Annotation,
Expand Down
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require (
github.com/checkpoint-restore/go-criu v0.0.0-20190109184317-bdb7599cd87b
github.com/containernetworking/cni v0.8.1
github.com/containernetworking/plugins v0.9.1
github.com/containers/buildah v1.19.8
github.com/containers/buildah v1.20.0
github.com/containers/common v0.35.4
github.com/containers/conmon v2.0.20+incompatible
github.com/containers/image/v5 v5.10.5
Expand All @@ -24,7 +24,7 @@ require (
github.com/davecgh/go-spew v1.1.1
github.com/digitalocean/go-qemu v0.0.0-20210209191958-152a1535e49f
github.com/docker/distribution v2.7.1+incompatible
github.com/docker/docker v20.10.0-beta1.0.20201113105859-b6bfff2a628f+incompatible
github.com/docker/docker v20.10.3-0.20210216175712-646072ed6524+incompatible
github.com/docker/go-connections v0.4.0
github.com/docker/go-plugins-helpers v0.0.0-20200102110956-c9a8a2d92ccc
github.com/docker/go-units v0.4.0
Expand All @@ -40,7 +40,7 @@ require (
github.com/json-iterator/go v1.1.10
github.com/kr/text v0.2.0 // indirect
github.com/mattn/go-colorable v0.1.8 // indirect
github.com/moby/term v0.0.0-20201110203204-bea5bbe245bf
github.com/moby/term v0.0.0-20201216013528-df9cb8a40635
github.com/mrunalp/fileutils v0.5.0
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
github.com/onsi/ginkgo v1.15.2
Expand All @@ -64,7 +64,7 @@ require (
github.com/vishvananda/netlink v1.1.1-0.20201029203352-d40f9887b852
go.etcd.io/bbolt v1.3.5
golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a
golang.org/x/sys v0.0.0-20210324051608-47abb6519492
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776
Expand Down
61 changes: 25 additions & 36 deletions go.sum

Large diffs are not rendered by default.

44 changes: 26 additions & 18 deletions test/buildah-bud/buildah-tests.diff
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
From c85882a8f7fb6efbf4d59dfe8340bfbef57ccd48 Mon Sep 17 00:00:00 2001
From f5fe46cc00aef5ca1837857e58e30328d04e875d Mon Sep 17 00:00:00 2001
From: Ed Santiago <santiago@redhat.com>
Date: Tue, 9 Feb 2021 17:28:05 -0700
Subject: [PATCH] tweaks for running buildah tests under podman

Signed-off-by: Ed Santiago <santiago@redhat.com>
---
tests/bud.bats | 26 ++++++++++++++++----------
tests/bud.bats | 27 +++++++++++++++++----------
tests/helpers.bash | 28 ++++++++++++++++++++++++----
2 files changed, 40 insertions(+), 14 deletions(-)
2 files changed, 41 insertions(+), 14 deletions(-)

diff --git a/tests/bud.bats b/tests/bud.bats
index 1efc3c58..9a39d594 100644
index cf55d9a4..446e2743 100644
--- a/tests/bud.bats
+++ b/tests/bud.bats
@@ -4,7 +4,7 @@ load helpers
@@ -4,5 +4,5 @@ load helpers

@test "bud with a path to a Dockerfile (-f) containing a non-directory entry" {
run_buildah 125 bud -f ${TESTSDIR}/bud/non-directory-in-path/non-directory/Dockerfile
Expand All @@ -22,15 +22,15 @@ index 1efc3c58..9a39d594 100644
}

@test "bud with --dns* flags" {
@@ -95,6 +95,7 @@ symlink(subdir)"
@@ -117,5 +117,6 @@ symlink(subdir)"
}

@test "bud-flags-order-verification" {
+ skip "N/A under podman"
run_buildah 125 bud /tmp/tmpdockerfile/ -t blabla
check_options_flag_err "-t"

@@ -1324,13 +1325,13 @@ function _test_http() {
@@ -1416,11 +1417,11 @@ function _test_http() {
@test "bud with dir for file but no Dockerfile in dir" {
target=alpine-image
run_buildah 125 bud --signature-policy ${TESTSDIR}/policy.json -t ${target} -f ${TESTSDIR}/bud/empty-dir ${TESTSDIR}/bud/empty-dir
Expand All @@ -46,7 +46,7 @@ index 1efc3c58..9a39d594 100644
}

@test "bud with ARG before FROM default value" {
@@ -1742,7 +1743,9 @@ _EOF
@@ -1834,4 +1835,6 @@ _EOF
run_buildah bud --signature-policy ${TESTSDIR}/policy.json --layers -t test-img-2 --build-arg TEST=foo -f Dockerfile4 ${TESTSDIR}/bud/build-arg
run_buildah inspect -f '{{.FromImageID}}' test-img-2
argsid="$output"
Expand All @@ -57,15 +57,15 @@ index 1efc3c58..9a39d594 100644

# Set the build-arg via an ENV in the local environment and verify that the cached layers are not used
export TEST=bar
@@ -1795,6 +1798,7 @@ _EOF
@@ -1887,1 +1890,1 @@ _EOF
}

@test "bud without any arguments should succeed" {
+ skip "does not work under podman"
cd ${TESTSDIR}/bud/from-scratch
run_buildah bud --signature-policy ${TESTSDIR}/policy.json
}
@@ -1802,7 +1806,7 @@ _EOF
@@ -1894,5 +1898,5 @@ _EOF
@test "bud without any arguments should fail when no Dockerfile exist" {
cd $(mktemp -d)
run_buildah 125 bud --signature-policy ${TESTSDIR}/policy.json
Expand All @@ -74,7 +74,7 @@ index 1efc3c58..9a39d594 100644
}

@test "bud with specified context should fail if directory contains no Dockerfile" {
@@ -1815,16 +1819,17 @@ _EOF
@@ -1907,11 +1911,11 @@ _EOF
DIR=$(mktemp -d)
mkdir -p "$DIR"/Dockerfile
run_buildah 125 bud --signature-policy ${TESTSDIR}/policy.json "$DIR"
Expand All @@ -94,7 +94,7 @@ index 1efc3c58..9a39d594 100644
DIR=$(mktemp -d)
echo "FROM alpine" > "$DIR"/Dockerfile
run_buildah 0 bud --signature-policy ${TESTSDIR}/policy.json "$DIR"/Dockerfile
@@ -1876,7 +1881,7 @@ _EOF
@@ -1968,5 +1973,5 @@ _EOF

@test "bud-squash-hardlinks" {
_prefetch busybox
Expand All @@ -103,31 +103,31 @@ index 1efc3c58..9a39d594 100644
}

@test "bud with additional directory of devices" {
@@ -2023,6 +2028,7 @@ _EOF
@@ -2115,1 +2120,1 @@ _EOF
}

@test "bud pull never" {
+ skip "FIXME: podman issue #9573"
target=pull
run_buildah 125 bud --signature-policy ${TESTSDIR}/policy.json -t ${target} --pull-never ${TESTSDIR}/bud/pull
expect_output --substring "pull policy is \"never\" but \""
@@ -2042,6 +2048,7 @@ _EOF
@@ -2134,6 +2140,7 @@ _EOF
}

@test "bud with Containerfile should fail with nonexistent authfile" {
+ skip "FIXME: podman issue #9572"
target=alpine-image
run_buildah 125 bud --authfile /tmp/nonexistent --signature-policy ${TESTSDIR}/policy.json -t ${target} ${TESTSDIR}/bud/containerfile
}
@@ -2169,6 +2176,7 @@ EOM
@@ -2261,6 +2268,7 @@ EOM
}

@test "bud with encrypted FROM image" {
+ skip "Too much effort to spin up a local registry"
_prefetch busybox
mkdir ${TESTDIR}/tmp
openssl genrsa -out ${TESTDIR}/tmp/mykey.pem 1024
@@ -2241,8 +2249,6 @@ EOM
@@ -2333,8 +2341,6 @@ EOM
_prefetch alpine
run_buildah bud --timestamp=0 --quiet --pull=false --signature-policy ${TESTSDIR}/policy.json -t timestamp -f Dockerfile.1 ${TESTSDIR}/bud/cache-stages
cid=$output
Expand All @@ -136,8 +136,16 @@ index 1efc3c58..9a39d594 100644
run_buildah inspect --format '{{ .OCIv1.Created }}' timestamp
expect_output --substring "1970-01-01"
run_buildah inspect --format '{{ .History }}' timestamp
@@ -2594,6 +2600,7 @@ _EOF
}

@test "bud with --arch flag" {
+ skip "N/A under podman"
_prefetch alpine
mytmpdir=${TESTDIR}/my-dir
mkdir -p ${mytmpdir}
diff --git a/tests/helpers.bash b/tests/helpers.bash
index 5623a0e7..9683360f 100644
index b28fd2c3..d42a6b82 100644
--- a/tests/helpers.bash
+++ b/tests/helpers.bash
@@ -70,7 +70,7 @@ function _prefetch() {
Expand All @@ -149,7 +157,7 @@ index 5623a0e7..9683360f 100644

for img in "$@"; do
echo "# [checking for: $img]" >&2
@@ -138,15 +138,35 @@ function run_buildah() {
@@ -138,16 +138,35 @@ function run_buildah() {
--retry) retry=3; shift;; # retry network flakes
esac

Expand Down
Loading

0 comments on commit 6fdc254

Please sign in to comment.