mirror of
https://github.com/coder/coder.git
synced 2026-09-22 05:05:20 +08:00
chore: ignore .git directories in terraform modules (#18255)
.git directories were causing identical modules to have different hashes. This adds unecessary bloat to the database, and the .git directory is not needed for dynamic params
This commit is contained in:
@@ -103,6 +103,13 @@ func GetModulesArchive(root fs.FS) ([]byte, error) {
|
||||
if !fileMode.IsRegular() && !fileMode.IsDir() {
|
||||
return nil
|
||||
}
|
||||
|
||||
// .git directories are not needed in the archive and only cause
|
||||
// hash differences for identical modules.
|
||||
if fileMode.IsDir() && d.Name() == ".git" {
|
||||
return fs.SkipDir
|
||||
}
|
||||
|
||||
fileInfo, err := d.Info()
|
||||
if err != nil {
|
||||
return xerrors.Errorf("failed to archive module file %q: %w", filePath, err)
|
||||
|
||||
Reference in New Issue
Block a user