2
2
3
3
BUILDAH_BINARY=${BUILDAH_BINARY:- $(dirname ${BASH_SOURCE} )/ ../ bin/ buildah}
4
4
IMGTYPE_BINARY=${IMGTYPE_BINARY:- $(dirname ${BASH_SOURCE} )/ ../ bin/ imgtype}
5
+ COPY_BINARY=${COPY_BINARY:- $(dirname ${BASH_SOURCE} )/ ../ bin/ copy}
5
6
TESTSDIR=${TESTSDIR:- $(dirname ${BASH_SOURCE} )}
6
7
STORAGE_DRIVER=${STORAGE_DRIVER:- vfs}
7
8
PATH=$( dirname ${BASH_SOURCE} ) /../bin:${PATH}
@@ -33,7 +34,6 @@ function setup() {
33
34
ROOTDIR_OPTS=" --root ${TESTDIR} /root --runroot ${TESTDIR} /runroot --storage-driver ${STORAGE_DRIVER} "
34
35
BUILDAH_REGISTRY_OPTS=" --registries-conf ${TESTSDIR} /registries.conf --registries-conf-dir ${TESTDIR} /registries.d --short-name-alias-conf ${TESTDIR} /cache/shortnames.conf"
35
36
PODMAN_REGISTRY_OPTS=" --registries-conf ${TESTSDIR} /registries.conf"
36
- COPY_OPTS=" $ROOTDIR_OPTS $BUILDAH_REGISTRY_OPTS "
37
37
}
38
38
39
39
function starthttpd() {
@@ -96,18 +96,18 @@ function _prefetch() {
96
96
fname=$( tr -c a-zA-Z0-9.- - <<< " $img" )
97
97
if [ -d $_BUILDAH_IMAGE_CACHEDIR /$fname ]; then
98
98
echo " # [restoring from cache: $_BUILDAH_IMAGE_CACHEDIR / $img ]" >&2
99
- copy $COPY_OPTS dir:$_BUILDAH_IMAGE_CACHEDIR /$fname containers-storage:" $img "
99
+ copy dir:$_BUILDAH_IMAGE_CACHEDIR /$fname containers-storage:" $img "
100
100
else
101
101
rm -fr $_BUILDAH_IMAGE_CACHEDIR /$fname
102
- echo " # [copy $COPY_OPTS docker://$img dir:$_BUILDAH_IMAGE_CACHEDIR /$fname ]" >&2
102
+ echo " # [copy docker://$img dir:$_BUILDAH_IMAGE_CACHEDIR /$fname ]" >&2
103
103
for attempt in $( seq 3) ; do
104
- if copy $COPY_OPTS docker://" $img " dir:$_BUILDAH_IMAGE_CACHEDIR /$fname ; then
104
+ if copy docker://" $img " dir:$_BUILDAH_IMAGE_CACHEDIR /$fname ; then
105
105
break
106
106
fi
107
107
sleep 5
108
108
done
109
- echo " # [copy $COPY_OPTS dir:$_BUILDAH_IMAGE_CACHEDIR /$fname containers-storage:$img ]" >&2
110
- copy $COPY_OPTS dir:$_BUILDAH_IMAGE_CACHEDIR /$fname containers-storage:" $img "
109
+ echo " # [copy dir:$_BUILDAH_IMAGE_CACHEDIR /$fname containers-storage:$img ]" >&2
110
+ copy dir:$_BUILDAH_IMAGE_CACHEDIR /$fname containers-storage:" $img "
111
111
fi
112
112
done
113
113
}
@@ -124,6 +124,10 @@ function imgtype() {
124
124
${IMGTYPE_BINARY} ${ROOTDIR_OPTS} " $@ "
125
125
}
126
126
127
+ function copy() {
128
+ ${COPY_BINARY} ${ROOTDIR_OPTS} ${BUILDAH_REGISTRY_OPTS} " $@ "
129
+ }
130
+
127
131
function podman() {
128
132
command podman ${PODMAN_REGISTRY_OPTS} ${ROOTDIR_OPTS} " $@ "
129
133
}
0 commit comments