summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.cirrus.yml26
-rw-r--r--cmd/podman/rmi.go25
-rw-r--r--contrib/cirrus/lib.sh5
-rw-r--r--contrib/cirrus/packer/centos_setup.sh2
-rw-r--r--contrib/cirrus/packer/fedora_setup.sh2
-rw-r--r--contrib/cirrus/packer/rhel_setup.sh2
-rw-r--r--contrib/cirrus/packer/ubuntu_setup.sh2
-rwxr-xr-xcontrib/cirrus/success.sh16
-rwxr-xr-xcontrib/python/podman/test/test_runner.sh1
9 files changed, 59 insertions, 22 deletions
diff --git a/.cirrus.yml b/.cirrus.yml
index 9d64bb5ab..f18e82653 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -57,7 +57,7 @@ env:
# Needed to build GCE images, within a GCE VM
SERVICE_ACCOUNT: ENCRYPTED[99e9a0b1c23f8dd29e83dfdf164f064cfd17afd9b895ca3b5e4c41170bd4290a8366fe2ad8e7a210b9f751711d1d002a]
# User ID for cirrus to ssh into VMs
- GCE_SSH_USERNAME: ENCRYPTED[a7706b9e4b8bbb47f76358df7407f4fffa2e8552531190cc0b3315180c4b50588f560c4f85731e99cb5f43a396778277]
+ GCE_SSH_USERNAME: cirrus-ci
# Name where this repositories cloud resources are located
GCP_PROJECT_ID: ENCRYPTED[7c80e728e046b1c76147afd156a32c1c57d4a1ac1eab93b7e68e718c61ca8564fc61fef815952b8ae0a64e7034b8fe4f]
@@ -77,6 +77,7 @@ env:
CIRRUS_WORKING_DIR CIRRUS_HTTP_CACHE_HOST PACKER_BUILDS BUILT_IMAGE_SUFFIX
XDG_DATA_DIRS XDG_RUNTIME_DIR XDG_SESSION_ID
+
# Every *_task runs in parallel in separate VMsd. The name prefix only for reference
# in WebUI, and will be followed by matrix details. This task gates all others with
# quick format, lint, and unit tests on the standard platform.
@@ -134,8 +135,6 @@ testing_task:
integration_test_script: $SCRIPT_BASE/integration_test.sh
- success_script: $SCRIPT_BASE/success.sh
-
# Because system tests are stored within the repository, it is sometimes
# necessary to execute them within a PR to validate changes.
@@ -162,7 +161,6 @@ optional_testing_task:
setup_environment_script: $SCRIPT_BASE/setup_environment.sh
system_test_script: $SCRIPT_BASE/system_test.sh
- success_script: $SCRIPT_BASE/success.sh
# Build new cache-images for future PR testing, but only after a PR merge.
@@ -208,3 +206,23 @@ cache_images_task:
# - clone_podman_release_branch.sh
# - modify_cirrus_yaml_image_names.sh
# - commit_and_create_upstream_pr.sh
+
+
+# Post message to IRC if everything passed
+success_task:
+
+ depends_on: # ignores any dependent task conditions
+ - "gating"
+ - "testing"
+ - "optional_testing"
+ - "cache_images"
+
+ env:
+ CIRRUS_WORKING_DIR: "/usr/src/libpod"
+
+ container:
+ image: "quay.io/libpod/gate:latest"
+ cpu: 1
+ memory: 1
+
+ success_script: $SCRIPT_BASE/success.sh
diff --git a/cmd/podman/rmi.go b/cmd/podman/rmi.go
index 0f4f8765b..910c7ba35 100644
--- a/cmd/podman/rmi.go
+++ b/cmd/podman/rmi.go
@@ -46,6 +46,13 @@ var (
)
func rmiCmd(c *cli.Context) error {
+ var (
+ lastError error
+ deleted bool
+ deleteErr error
+ msg string
+ )
+
ctx := getContext()
if err := validateFlags(c, rmiFlags); err != nil {
return err
@@ -66,20 +73,18 @@ func rmiCmd(c *cli.Context) error {
}
images := args[:]
- var lastError error
- var deleted bool
removeImage := func(img *image.Image) {
deleted = true
- msg, err := runtime.RemoveImage(ctx, img, c.Bool("force"))
- if err != nil {
- if errors.Cause(err) == storage.ErrImageUsedByContainer {
+ msg, deleteErr = runtime.RemoveImage(ctx, img, c.Bool("force"))
+ if deleteErr != nil {
+ if errors.Cause(deleteErr) == storage.ErrImageUsedByContainer {
fmt.Printf("A container associated with containers/storage, i.e. via Buildah, CRI-O, etc., may be associated with this image: %-12.12s\n", img.ID())
}
if lastError != nil {
fmt.Fprintln(os.Stderr, lastError)
}
- lastError = err
+ lastError = deleteErr
} else {
fmt.Println(msg)
}
@@ -108,6 +113,14 @@ func rmiCmd(c *cli.Context) error {
}
lastNumberofImages = len(imagesToDelete)
imagesToDelete, err = runtime.ImageRuntime().GetImages()
+ if err != nil {
+ return err
+ }
+ // If no images are left to delete or there is just one image left and it cannot be deleted,
+ // lets break out and display the error
+ if len(imagesToDelete) == 0 || (lastNumberofImages == 1 && lastError != nil) {
+ break
+ }
}
} else {
// Create image.image objects for deletion from user input.
diff --git a/contrib/cirrus/lib.sh b/contrib/cirrus/lib.sh
index 51db203fd..3b567b7a7 100644
--- a/contrib/cirrus/lib.sh
+++ b/contrib/cirrus/lib.sh
@@ -123,12 +123,11 @@ stub() {
ircmsg() {
req_env_var "
- SCRIPT_BASE $SCRIPT_BASE
- GOSRC $GOSRC
CIRRUS_TASK_ID $CIRRUS_TASK_ID
1 $1
"
- SCRIPT="$GOSRC/$SCRIPT_BASE/podbot.py"
+ # Sometimes setup_environment.sh didn't run
+ SCRIPT="$(dirname $0)/podbot.py"
NICK="podbot_$CIRRUS_TASK_ID"
NICK="${NICK:0:15}" # Any longer will break things
set +e
diff --git a/contrib/cirrus/packer/centos_setup.sh b/contrib/cirrus/packer/centos_setup.sh
index 7b2308739..a13050569 100644
--- a/contrib/cirrus/packer/centos_setup.sh
+++ b/contrib/cirrus/packer/centos_setup.sh
@@ -29,6 +29,7 @@ ooe.sh sudo yum -y install \
btrfs-progs-devel \
bzip2 \
device-mapper-devel \
+ emacs-nox \
findutils \
glib2-devel \
glibc-static \
@@ -63,6 +64,7 @@ ooe.sh sudo yum -y install \
runc \
skopeo-containers \
unzip \
+ vim \
which \
xz
diff --git a/contrib/cirrus/packer/fedora_setup.sh b/contrib/cirrus/packer/fedora_setup.sh
index a14e1b01f..01c468901 100644
--- a/contrib/cirrus/packer/fedora_setup.sh
+++ b/contrib/cirrus/packer/fedora_setup.sh
@@ -29,6 +29,7 @@ ooe.sh sudo dnf install -y \
btrfs-progs-devel \
bzip2 \
device-mapper-devel \
+ emacs-nox \
findutils \
git \
glib2-devel \
@@ -66,6 +67,7 @@ ooe.sh sudo dnf install -y \
skopeo-containers \
slirp4netns \
unzip \
+ vim \
which \
xz
diff --git a/contrib/cirrus/packer/rhel_setup.sh b/contrib/cirrus/packer/rhel_setup.sh
index 7f0d4e589..99376fd65 100644
--- a/contrib/cirrus/packer/rhel_setup.sh
+++ b/contrib/cirrus/packer/rhel_setup.sh
@@ -35,6 +35,7 @@ ooe.sh sudo yum -y install \
btrfs-progs-devel \
bzip2 \
device-mapper-devel \
+ emacs-nox \
findutils \
glib2-devel \
glibc-static \
@@ -69,6 +70,7 @@ ooe.sh sudo yum -y install \
runc \
skopeo-containers \
unzip \
+ vim \
which \
xz
diff --git a/contrib/cirrus/packer/ubuntu_setup.sh b/contrib/cirrus/packer/ubuntu_setup.sh
index 6e3613462..af5671c90 100644
--- a/contrib/cirrus/packer/ubuntu_setup.sh
+++ b/contrib/cirrus/packer/ubuntu_setup.sh
@@ -37,6 +37,7 @@ ooe.sh sudo -E apt-get -qq install --no-install-recommends \
build-essential \
curl \
e2fslibs-dev \
+ emacs-nox \
gawk \
gettext \
go-md2man \
@@ -76,6 +77,7 @@ ooe.sh sudo -E apt-get -qq install --no-install-recommends \
python3-setuptools \
socat \
unzip \
+ vim \
xz-utils
echo "Fixing Ubuntu kernel not enabling swap accounting by default"
diff --git a/contrib/cirrus/success.sh b/contrib/cirrus/success.sh
index d1daf9043..2b0cf4655 100755
--- a/contrib/cirrus/success.sh
+++ b/contrib/cirrus/success.sh
@@ -1,22 +1,20 @@
#!/bin/bash
set -e
+
source $(dirname $0)/lib.sh
req_env_var "
- CIRRUS_TASK_NAME $CIRRUS_TASK_NAME
CIRRUS_BRANCH $CIRRUS_BRANCH
- OS_RELEASE_ID $OS_RELEASE_ID
- OS_RELEASE_VER $OS_RELEASE_VER
- CIRRUS_REPO_CLONE_URL $CIRRUS_REPO_CLONE_URL
+ CIRRUS_BUILD_ID $CIRRUS_BUILD_ID
"
-REF_URL="$(echo $CIRRUS_REPO_CLONE_URL | sed 's/.git$//g')"
+REF=$(basename $CIRRUS_BRANCH) # PR number or branch named
+URL="https://cirrus-ci.com/build/$CIRRUS_BUILD_ID"
+
if [[ "$CIRRUS_BRANCH" =~ "pull" ]]
then
- REF_URL="$REF_URL/$CIRRUS_BRANCH" # pull request URL
+ ircmsg "Cirrus-CI testing successful for PR #$REF: $URL"
else
- REF_URL="$REF_URL/commits/$CIRRUS_BRANCH" # branch merge
+ ircmsg "Cirrus-CI testing branch $REF successful: $URL"
fi
-
-ircmsg "Cirrus-CI $CIRRUS_TASK_NAME on $OS_RELEASE_ID-$OS_RELEASE_VER successful for $REF_URL"
diff --git a/contrib/python/podman/test/test_runner.sh b/contrib/python/podman/test/test_runner.sh
index bf097e2b2..651b2e74f 100755
--- a/contrib/python/podman/test/test_runner.sh
+++ b/contrib/python/podman/test/test_runner.sh
@@ -41,6 +41,7 @@ export TMPDIR=`mktemp -d /tmp/podman.XXXXXXXXXX`
trap "cleanup $TMPDIR" EXIT
function umount {
+ set +xeuo pipefail
# xargs -r always ran once, so write any mount points to file first
mount |awk "/$1/"' { print $3 }' >${TMPDIR}/mounts
if [[ -s ${TMPDIR}/mounts ]]; then