mirror of
https://github.com/coder/coder.git
synced 2026-06-02 20:48:20 +00:00
fix: correct hasAITaskResources logic for child modules (#18542)
This commit is contained in:
@@ -178,7 +178,9 @@ func hasAITaskResources(graph *gographviz.Graph) bool {
|
||||
// Check if this node is a coder_ai_task resource
|
||||
if label, exists := node.Attrs["label"]; exists {
|
||||
labelValue := strings.Trim(label, `"`)
|
||||
if strings.HasPrefix(labelValue, "coder_ai_task.") {
|
||||
// The first condition is for the case where the resource is in the root module.
|
||||
// The second condition is for the case where the resource is in a child module.
|
||||
if strings.HasPrefix(labelValue, "coder_ai_task.") || strings.Contains(labelValue, ".coder_ai_task.") {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user