Skip to content
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

Follow symlinks when copying automation repositories #49

Merged
merged 1 commit into from
May 3, 2021

Conversation

paulbarfuss
Copy link
Contributor

What does this PR do?

Allows resource-dispatcher to clone and copy repositories containing symlinks with shutil.copytree

How should this be tested?

The infra-ansible repository is an example of one that will fail at this step due to symlinks that will recurse to an infinite path.

repositories:
  - name: infra-ansible
    url: https://github.com/redhat-cop/infra-ansible.git
    ref: main

This seems to run immediately when the first task is received by the dispatcher and will cause the /tmp dir to recursively fill up with symlinks, for example:

$ ls -alh roles/rhsm/tests/roles/rhsm/tests/roles/rhsm/tests/roles/rhsm/tests/roles/rhsm/tests/roles/rhsm/tests/roles/rhsm/tests/roles/rhsm/tests/roles/rhsm/tests/roles/rhsm/tests/roles/rhsm/tests/roles/rhsm/tests/roles/rhsm/tests/roles/rhsm/tests/
total 20K
drwxrwxr-x. 3 xxx xxx 4.0K Jan 27 10:44 .
drwxrwxr-x. 4 xxx xxx 4.0K Jan 27 10:44 ..
drwxrwxr-x. 2 xxx xxx 4.0K Jan 27 10:44 group_vars
-rw-rw-r--. 1 xxx xxx   75 Jan 27 10:44 inventory
lrwxrwxrwx. 1 xxx xxx   14 Jan 27 10:44 roles -> ../../../roles
-rw-rw-r--. 1 xxx xxx  111 Jan 27 10:44 test.yml

Is there a relevant Issue open for this?

N/A

Other Relevant info, PRs, etc.

Please provide link to other PRs that may be related (blocking, resolves, etc. etc.)

People to notify

cc: @redhat-cop/tool-integrations

Copy link
Contributor

@jacobsee jacobsee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@jacobsee jacobsee merged commit af7fadd into redhat-cop:master May 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants