Skip to content

Can't create or push template directories containing folders prefixed with . #4369

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

Closed
kconley-sq opened this issue Oct 4, 2022 · 0 comments · Fixed by #4370
Closed

Can't create or push template directories containing folders prefixed with . #4369

kconley-sq opened this issue Oct 4, 2022 · 0 comments · Fixed by #4370
Assignees

Comments

@kconley-sq
Copy link
Contributor

Trying to create or push a new version of an existing template is failing on our macOS laptops if we have a folder somewhere in our template directory whose name is prefixed with . and contains at least one file:

❯ coder templates create --verbose -d path/to/my/template/folder my-template-name
> Create and upload "path/to/my/template/folder"? (yes/no) 
✔ Queued [331ms]
✔ Cleaning Up [-65ms]
✘ Setting up [176ms]
create file "/tmp/provisionerdXXXXXXXXXX/subfolder/.hooks/pre-commit" (mode -rw-r--r--): open /tmp/provisionerdXXXXXXXXXX/subfolder/.hooks/pre-commit: no such file or directory
Run 'coder templates create --help' for usage.

The subfolder/.hooks/pre-commit file mentioned in the output above is a sh script that is used as a git pre-commit hook by a repo which is a git submodule within the path/to/my/template/folder template directory (subfolder/). We don't need it to be uploaded to our Coder server as part of publishing the template, but I'm not sure if there are any mechanisms we could use to make Coder ignore it.

Another case where we saw this is when the template directory was itself a git repo, and in that case the error seemed to be complaining about a file within the .git directory:

❯ coder template push my-template-name  
> Upload "path/to/my/template/folder"? (yes/no) yes
✔ Queued [476ms]
✔ Cleaning Up [-61ms]
✘ Setting up [238ms]
create file "/tmp/provisionerdXXXXXXXXXX/.git/COMMIT_EDITMSG" (mode -rw-r--r--): open /tmp/provisionerdXXXXXXXXXX/.git/COMMIT_EDITMSG: no such file or directory
Run 'coder templates push --help' for usage.

We're seeing this in both version 0.9.1 and 0.9.2 of the Coder CLI tool but did not see it in 0.8.1.

Could this be related to #3997?

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 a pull request may close this issue.

2 participants