Skip to content

Commit b212e93

Browse files
authored
Merge pull request #62 from cisagov/bugfix/fix_parallelism_issues_in_validate
Force the `packer_validate` hook to be run in serial by `pre-commit`
2 parents 271a629 + 81b0d35 commit b212e93

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

.pre-commit-hooks.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,11 @@
1313
id: packer_validate
1414
language: script
1515
name: Packer Validate
16+
# This is necessary because Packer's plugin cache is not safe for concurrent access
17+
# per https://github.com/hashicorp/terraform/issues/32915#issuecomment-1485061999. If
18+
# this is not set to true then pre-commit itself will perform some level of
19+
# parallelization across the files to run this hook against. Since we only care about
20+
# unique directory paths it should not impact performance and it will help prevent
21+
# issues arising from concurrent attempts to perform `packer init` on a particular
22+
# directory path.
23+
require_serial: true

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ against any directory that houses `.pkr.hcl` files.
3434
```yaml
3535
repos:
3636
- repo: https://github.com/cisagov/pre-commit-packer
37-
rev: v0.3.0
37+
rev: v0.3.1
3838
hooks:
3939
- id: packer_fmt
4040
- id: packer_validate

config/version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.3.0
1+
0.3.1

0 commit comments

Comments
 (0)