Skip to content

Commit b6c493d

Browse files
authored
fix: correct hasAITaskResources logic for child modules (#18542)
1 parent b2009b2 commit b6c493d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

provisioner/terraform/resources.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,9 @@ func hasAITaskResources(graph *gographviz.Graph) bool {
178178
// Check if this node is a coder_ai_task resource
179179
if label, exists := node.Attrs["label"]; exists {
180180
labelValue := strings.Trim(label, `"`)
181-
if strings.HasPrefix(labelValue, "coder_ai_task.") {
181+
// The first condition is for the case where the resource is in the root module.
182+
// The second condition is for the case where the resource is in a child module.
183+
if strings.HasPrefix(labelValue, "coder_ai_task.") || strings.Contains(labelValue, ".coder_ai_task.") {
182184
return true
183185
}
184186
}

0 commit comments

Comments
 (0)