Closed JoshuaSmeda closed 2 years ago
This is caused by a Linux kernel bug which is affecting Docker. Copying files from a docker-mounted volume to the root filesystem can result in empty files. See here for details: https://github.com/docker/for-linux/issues/1015
In this case it's onceover copying from the repo's files to a dir under /tmp. A workaround using linux is to mount /tmp as tmpfs when running the container, or for Docker on non-linux platforms you can avoid the issue by keeping the temp directory inside the repo's docker volume, e.g. by putting it under ./.onceover/
:
# ruby will create temporary files under the dir specified by the TMP envar
$ export TMP=$(pwd)/.onceover/tmp
# the temp dir has to exist, otherwise Ruby won't use it
$ mkdir -p $TMP
$ bundler exec onceover run
...
Wow brilliant catch! I'm going to close this as we have a workaround and it's definitely not a Onceover issue. Hopefully will be resolved upstream soon
Container: Docker, running under Kubernetes. Using
ruby:2.7
image. Onceover release: 3.20.0 Ruby version: ruby 2.7.5p203 (2021-11-24 revision f69aeb8314) [x86_64-linux]Gem list: >
When attempting to run
bundle exec onceover run spec
, I receive the following error/s:I'm unable to perform hieradata lookups, which should work considering that my config is correct.
Onceover doesn't use the 'correct' hiera.yaml config file, because my mock data doesn't work either.
Upon further investigation, the directory -
.onceover/etc/puppetlabs/code/environments/production/spec
contains all the necessary files but they are empty when they shouldn't be:These files are not empty under the
controlrepo
or under.onceover/spec
. There is something wrong with the FileUtils.CP.I've attached the cucumber tests to this issue which has MD5 hashes failures indicating there is a problem with the copying. cucumber_tests.log
It's worth noting that this works locally, in Docker using the same image which indicates that my
controlrepo
and configuration is likely not the issue but there might be a bug in Onceover.