umoci
umoci copied to clipboard
spurrious whiteout rejection failures (error not propagated)
It appears that the whiteout rejection code (which is implemented through CloseWithError) can fail spurriously. I've noticed this failure in the past but it appears that it's happening much more often in our CI (causing it to fail):
not ok 73 umoci repack [whiteout]
# (in test file test/repack.bats, line 172)
# `[ "$status" -ne 0 ]' failed
# oci-image-tool: reference "latest": OK
# /tmp/umoci-integration/umoci-integration-tmpdir.IAQ0Qfmf/image: OK
# Validation succeeded
# df (status=0)
# Filesystem 1K-blocks Used Available Use% Mounted on
# overlay 71088948 14596812 56475752 21% /
# tmpfs 65536 0 65536 0% /dev
# tmpfs 4084220 0 4084220 0% /sys/fs/cgroup
# /dev/sda1 71088948 14596812 56475752 21% /etc/hosts
# shm 65536 0 65536 0% /dev/shm
# tmpfs 4084220 0 4084220 0% /proc/acpi
# tmpfs 4084220 0 4084220 0% /proc/scsi
# tmpfs 4084220 0 4084220 0% /sys/firmware
# du -h -d 2 /tmp/umoci-integration/umoci-integration-tmpdir.agv5xRAj (status=0)
# 4.0K /tmp/umoci-integration/umoci-integration-tmpdir.agv5xRAj
# umoci -test.coverprofile=/tmp/umoci-coverage.cuRihw/umoci.cov.59NMYn __DEVEL--i-heard-you-like-tests unpack --image /tmp/umoci-integration/umoci-integration-tmpdir.IAQ0Qfmf/image:latest /tmp/umoci-integration/umoci-integration-tmpdir.agv5xRAj/umoci-integration-tmpdir.B10VXimo (status=0)
# PASS
# coverage: 24.9% of statements in ./...
# Bundle validation succeeded.
# umoci -test.coverprofile=/tmp/umoci-coverage.cuRihw/umoci.cov.7M7ITq __DEVEL--i-heard-you-like-tests repack --image /tmp/umoci-integration/umoci-integration-tmpdir.IAQ0Qfmf/image:latest-new /tmp/umoci-integration/umoci-integration-tmpdir.agv5xRAj/umoci-integration-tmpdir.B10VXimo (status=0)
# PASS
# coverage: 18.8% of statements in ./...
# oci-image-tool: reference "latest": OK
# oci-image-tool: reference "latest-new": OK
# /tmp/umoci-integration/umoci-integration-tmpdir.IAQ0Qfmf/image: OK
# Validation succeeded
# umoci -test.coverprofile=/tmp/umoci-coverage.cuRihw/umoci.cov.f2j0qE __DEVEL--i-heard-you-like-tests unpack --image /tmp/umoci-integration/umoci-integration-tmpdir.IAQ0Qfmf/image:latest-new /tmp/umoci-integration/umoci-integration-tmpdir.agv5xRAj/umoci-integration-tmpdir.ffYJ1M7n (status=0)
# PASS
# coverage: 24.1% of statements in ./...
# Bundle validation succeeded.
# gomtree -K sha256digest -p /tmp/umoci-integration/umoci-integration-tmpdir.agv5xRAj/umoci-integration-tmpdir.B10VXimo/rootfs -f /tmp/umoci-integration/umoci-integration-tmpdir.agv5xRAj/umoci-integration-tmpdir.ffYJ1M7n/sha256_2a1083ca750ab3ef7090ff5d05915b630f9b6f4fbb2bf9305e6eb5f965b11614.mtree (status=0)
#
# umoci -test.coverprofile=/tmp/umoci-coverage.cuRihw/umoci.cov.56yPQm __DEVEL--i-heard-you-like-tests stat --image /tmp/umoci-integration/umoci-integration-tmpdir.IAQ0Qfmf/image:latest-new --json (status=0)
# {"history":[{"layer":{"mediaType":"application/vnd.oci.image.layer.v1.tar+gzip","digest":"sha256:376057ac6fa17f65688c56977118e2e764b27c348b3f70637fa829cd2a12b200","size":50391294},"diff_id":"sha256:8c02234b86056c009036ff0c31efb9a726412392d9872dacf95103767ac3b101","created":"2020-05-15T06:28:12.60008518Z","created_by":"/bin/sh -c #(nop) ADD file:fb54c709daa205bf9d04eb3d90ba068db4c34dfe3b6ec0d7691f677286120903 in / "},{"layer":null,"diff_id":"","created":"2020-05-15T06:28:13.142776633Z","created_by":"/bin/sh -c #(nop) CMD [\"bash\"]","empty_layer":true},{"layer":{"mediaType":"application/vnd.oci.image.layer.v1.tar+gzip","digest":"sha256:623029273a2b8571d91fe12d0a602a3591d6b5c2c92269aca560b4bb00030dfe","size":234},"diff_id":"sha256:f58f13f1a93fd64e89ba4494db48852ea9eca5581508e76e7fa940b8622ed8c4","created":"2020-06-05T21:53:27.884107403Z","created_by":"umoci repack"}]}
# PASS
# coverage: 9.2% of statements in ./...
# umoci -test.coverprofile=/tmp/umoci-coverage.cuRihw/umoci.cov.iCcaOy __DEVEL--i-heard-you-like-tests repack --image /tmp/umoci-integration/umoci-integration-tmpdir.IAQ0Qfmf/image:latest-new2 /tmp/umoci-integration/umoci-integration-tmpdir.agv5xRAj/umoci-integration-tmpdir.ffYJ1M7n (status=1)
# • generate layer: could not add file 'whiteout_test/.wh. THIS IS A TEST ': invalid path has whiteout prefix ".wh.": whiteout_test/.wh. THIS IS A TEST
# ⨯ add diff layer: add layer: put layer blob: copy to temporary blob: compressing layer: generate layer: generate layer file: invalid path has whiteout prefix ".wh.": whiteout_test/.wh. THIS IS A TEST
# oci-image-tool: reference "latest": OK
# oci-image-tool: reference "latest-new": OK
# /tmp/umoci-integration/umoci-integration-tmpdir.IAQ0Qfmf/image: OK
# Validation succeeded
# umoci -test.coverprofile=/tmp/umoci-coverage.cuRihw/umoci.cov.7edOFs __DEVEL--i-heard-you-like-tests repack --image /tmp/umoci-integration/umoci-integration-tmpdir.IAQ0Qfmf/image:latest-new3 /tmp/umoci-integration/umoci-integration-tmpdir.agv5xRAj/umoci-integration-tmpdir.ffYJ1M7n (status=0)
# • generate layer: could not add file '.wh.another_whiteout': invalid path has whiteout prefix ".wh.": .wh.another_whiteout/
# PASS
# coverage: 18.4% of statements in ./...
Note that the second invocation of umoci (where the test failure occurs), only the logged warning is printed and there isn't a
# ⨯ add diff layer: add layer: put layer blob: copy to temporary blob: compressing layer: generate layer: generate layer file: invalid path has whiteout prefix ".wh.": whiteout_test/.wh. THIS IS A TEST
line afterwards, indicating that the error never made it to the top-level main function.