File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -210,6 +210,20 @@ pullImages() {
210210 failExit $? " Image layerinfo on plain image failed"
211211}
212212
213+ remove_all_snapshots ()
214+ {
215+ local v
216+
217+ # to avoid caching effects of the image we just decrypted and then exported,
218+ # remove all snapshots to simulate a clean system for import
219+ # The following is a brute-force removal ignoring dependencies
220+ while [ -n " $( $CTR snapshot ls | tail -n +2) " ]; do
221+ for v in $( $CTR snapshot ls | tail -n +2 | cut -d" " -f1) ; do
222+ $CTR snapshot rm $v & > /dev/null
223+ done
224+ done
225+ }
226+
213227setupPGP () {
214228 GPGHOMEDIR=${WORKDIR} /gpg2
215229
@@ -312,14 +326,9 @@ testPGP() {
312326
313327 # remove ${ALPINE} and ${ALPINE_ENC} to clear cached and so we need to decrypt
314328 $CTR images rm --sync ${ALPINE} ${ALPINE_ENC} & > /dev/null
315- # to avoid caching effects of the image we just decrypted and then exported,
316- # remove all snapshots to simulate a clean system for import
317- # The following is a brute-force removal ignoring dependencies
318- while [ -n " $( $CTR snapshot ls | tail -n +2) " ]; do
319- for v in $( $CTR snapshot ls | tail -n +2 | cut -d" " -f1) ; do
320- $CTR snapshot rm $v & > /dev/null
321- done
322- done
329+
330+ remove_all_snapshots
331+
323332
324333 $CTR images import \
325334 --all-platforms \
You can’t perform that action at this time.
0 commit comments