Skip to content

Commit 1c41920

Browse files
committed
Update/add comments
1 parent 9510bb8 commit 1c41920

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

override.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,8 @@ func mergeOverrideFiles(original fs.FS) (fs.FS, error) {
135135
}
136136
}
137137
if !matched {
138+
// Terraform requires every override block to have a corresponding
139+
// primary block — override files can only modify, not create.
138140
return nil, fmt.Errorf("override block %s in %s has no matching block in a primary configuration file", key, path)
139141
}
140142
}

preview.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,10 +211,10 @@ func Preview(ctx context.Context, input Input, dir fs.FS) (output *Output, diagn
211211
}
212212

213213
// Merge override files into primary files before parsing, so Trivy
214-
// sees pre-merged content with no duplicate blocks. This replicates
214+
// sees post-merge content with no duplicate blocks. This replicates
215215
// Terraform's override file semantics.
216216
//
217-
// TODO: I'd be nice if Trivy did it for us.
217+
// TODO: It'd be nice if Trivy did this for us.
218218
dir, err = mergeOverrideFiles(dir)
219219
if err != nil {
220220
return nil, hcl.Diagnostics{

0 commit comments

Comments
 (0)