Skip to content

Commit c11081a

Browse files
authored
Merge pull request #91 from coder/stevenmasley/do_not_warn_non_coder
chore: do not warn for non-coder blocks
2 parents 7edcb9e + 409c430 commit c11081a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

warnings.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package preview
22

33
import (
44
"fmt"
5+
"strings"
56

67
"github.com/aquasecurity/trivy/pkg/iac/terraform"
78
"github.com/hashicorp/hcl/v2"
@@ -24,6 +25,10 @@ func unexpandedCountBlocks(modules terraform.Modules) hcl.Diagnostics {
2425
for _, block := range modules.GetBlocks() {
2526
block := block
2627

28+
// Only warn on coder blocks
29+
if !strings.HasPrefix(block.NameLabel(), "coder_") {
30+
continue
31+
}
2732
if countAttr, ok := block.Attributes()["count"]; ok {
2833
if block.IsExpanded() {
2934
continue

0 commit comments

Comments
 (0)