Limit depth on git cleanup

nodepool is getting cron errors

fatal: bad numeric config value 'no' for 'gc.auto'
 in /opt/dib_cache/source-repositories/deb_python_pygit2_...
   /test/data/testrepo.git/config: invalid unit

as it is picking up [1].  What are the odds?!

Limit the search to -depth 1 to avoid going any further than top-level
directorires.

[1] https://git.openstack.org/cgit/openstack/deb-python-pygit2/tree/test/data/testrepo.git/config

Change-Id: I062805fe142610c7b3ab2eb422a230f7296cbca5
This commit is contained in:
Ian Wienand 2017-04-12 09:20:39 +10:00
parent 66c6598c91
commit d6279ce42a

View File

@ -900,7 +900,7 @@ node 'nodepool.openstack.org' {
user => 'nodepool',
hour => '20',
minute => '0',
command => 'find /opt/dib_cache/source-repositories/ -type d -name "*.git" -exec git --git-dir="{}" gc \; >/dev/null',
command => 'find /opt/dib_cache/source-repositories/ -maxdepth 1 -type d -name "*.git" -exec git --git-dir="{}" gc \; >/dev/null',
environment => 'PATH=/usr/bin:/bin:/usr/sbin:/sbin',
require => Class['::openstackci::nodepool'],
}