You try to run a unit test in Puppet Development Kit by running
PDK test unit in the PDK Docker container as a non-root user. It fails with an unable to open
/pdk/config/namespace.rb:331:in `rescue in save_data': Unable to open /.config/ puppet/analytics.yml for writing (PDK::Config::LoadError)
Version and installation information
PDK version: 2.3.0
Installation type: Docker container image
PDK is designed to be run as the root user in a Docker container, so
analytics.yml is normally written to the root directory. To run it as a non-root user, set the
HOME variable as writable by UID 1000.
docker run -u 1000:1000 -e HOME=/project --workdir /project --rm -v $(pwd):/project puppet/pdk test unit
How can we improve this article?
Please sign in to leave a comment.