@@ -750,17 +750,17 @@ func convertAddressToLabel(address string) string {
750
750
return cut
751
751
}
752
752
753
- func dependsOnAgent (graph * gographviz.Graph , agent * proto.Agent , appAgentID string , resource * tfjson.StateResource ) bool {
753
+ func dependsOnAgent (graph * gographviz.Graph , agent * proto.Agent , resourceAgentID string , resource * tfjson.StateResource ) bool {
754
754
// Plan: we need to find if there is edge between the agent and the resource.
755
- if agent .Id == "" && appAgentID == "" {
756
- appNodeSuffix := fmt .Sprintf (`] %s.%s (expand)"` , resource .Type , resource .Name )
755
+ if agent .Id == "" && resourceAgentID == "" {
756
+ resourceNodeSuffix := fmt .Sprintf (`] %s.%s (expand)"` , resource .Type , resource .Name )
757
757
agentNodeSuffix := fmt .Sprintf (`] coder_agent.%s (expand)"` , agent .Name )
758
758
759
759
// Traverse the graph to check if the coder_<resource_type> depends on coder_agent.
760
760
for _ , dst := range graph .Edges .SrcToDsts {
761
761
for _ , edges := range dst {
762
762
for _ , edge := range edges {
763
- if strings .HasSuffix (edge .Src , appNodeSuffix ) &&
763
+ if strings .HasSuffix (edge .Src , resourceNodeSuffix ) &&
764
764
strings .HasSuffix (edge .Dst , agentNodeSuffix ) {
765
765
return true
766
766
}
@@ -770,8 +770,8 @@ func dependsOnAgent(graph *gographviz.Graph, agent *proto.Agent, appAgentID stri
770
770
return false
771
771
}
772
772
773
- // Provision: agent ID and app ID are present
774
- return agent .Id == appAgentID
773
+ // Provision: agent ID and child resource ID are present
774
+ return agent .Id == resourceAgentID
775
775
}
776
776
777
777
type graphResource struct {
0 commit comments