Error in GitLab runner version v17.10.0 and cleaning git configuration
Problem
After upgrading our GitLab Runners to v17.10.0 we see a problem with the cleaning git configuration feature. After upgrading, none of our pipelines with submodules running successfully. We see the error:
Getting source from Git repository
00:01
Fetching changes with git depth set to 50...
rm: '/our-base-path/.git/modules/config' is a directory
Possible solution
Because we have submodule strategy recursive enabled, I think that is the call for the cleanup:
https://gitlab.com/gitlab-org/gitlab-runner/-/blob/main/shells/abstract.go?ref_type=heads#L731
The function that executes the file removal is here:
https://gitlab.com/gitlab-org/gitlab-runner/-/blob/main/shells/bash.go?ref_type=heads#L291
The issue is that you find files and directories but only delete files rm -f
. I think the correct execution should be:
b.Linef("find %q -name %q -type f -exec rm -f {} +", path, name)
With -type f
there should be only files returned by find
and the rm -f
should work as expected.
If you agree with that fix, I could create an MR with that fix.