-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
salt.states.git.cloned can't clone into an existing directory #55926
Comments
Thanks for the report, and including that work around. If you're able to successfully run a Have you tried running a |
I've changed the target to a directory under /tmp and run a few more trials to look at the behaviour.
This appears to be coming from the git.status test at Line 2849 in 12c5b33
|
Ahh, interesting! Thanks for running a few more tests on it, and it does seem to be coming from the |
Just ran into the same issue, thanks for posting. |
same issue - thank you for taking the time to be thorough @iaingeorgeson |
Experienced this issue as well: clone_bla_bla: clone_bla_bla: |
I got the same problem with |
I got this error too, I worked it around by using git.latest. |
Same issue is still present. using |
Description of Issue
Attempting to use git.cloned where "target" directory already exists results in an error:
Comment: Command 'git status -z --porcelain' failed: fatal: not a git repository (or any of the parent directories): .git
Setup
(Please provide relevant configs and/or SLS files (Be sure to remove sensitive info).)
I'm bootstrapping my salt master. Largely untouched Debian buster running latest salt. Applied using
# salt-call --local --file-root=$top/salt --pillar-root=$top/pillar --id=$(hostname -f) state.highstate $@
Steps to Reproduce Issue
(Include debug logs if possible and relevant.)
I want to set up a git clone in /srv/salt-master. /srv is root:root 0755. /srv/salt-master is salt:salt 0750. As user "salt" is unable to create a directory in /srv, I use a salt state to create /srv/salt-master:
/srv/salt-master/:
file.directory:
- user: salt
- group: salt
- mode: 0750
and then attempt to clone into it with
clone-bare-repo:
git.cloned:
- name: /srv/git/salt-yhhyt.git/
- target: /srv/salt-master/
- user: salt
Result is
An alternative attempt replacing git.cloned with this cmd.run is sucessful:
clone-bare-repo:
cmd.run:
- name: git clone /srv/git/salt-yhhyt /srv/salt-master/
- creates: /srv/salt-master/.git/
- runas: salt
Versions Report
(Provided by running
salt --versions-report
. Please also mention any differences in master/minion versions.)root@havelock:~/git/salt-yhhyt# salt --versions-report
Salt Version:
Salt: 2019.2.3
Dependency Versions:
cffi: Not Installed
cherrypy: Not Installed
dateutil: 2.7.3
docker-py: Not Installed
gitdb: 2.0.5
gitpython: 2.1.11
ioflo: Not Installed
Jinja2: 2.10
libgit2: Not Installed
libnacl: Not Installed
M2Crypto: Not Installed
Mako: Not Installed
msgpack-pure: Not Installed
msgpack-python: 0.5.6
mysql-python: Not Installed
pycparser: Not Installed
pycrypto: 2.6.1
pycryptodome: Not Installed
pygit2: Not Installed
Python: 3.7.3 (default, Apr 3 2019, 05:39:12)
python-gnupg: Not Installed
PyYAML: 3.13
PyZMQ: 17.1.2
RAET: Not Installed
smmap: 2.0.5
timelib: Not Installed
Tornado: 4.5.3
ZMQ: 4.3.1
System Versions:
dist: debian 10.2
locale: ISO-8859-1
machine: x86_64
release: 4.19.0-6-cloud-amd64
system: Linux
version: debian 10.2
The text was updated successfully, but these errors were encountered: