Skip to content

Commit 1d2f797

Browse files
committed
fix: naming
1 parent 3aea666 commit 1d2f797

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

provisioner/terraform/resources.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -750,17 +750,17 @@ func convertAddressToLabel(address string) string {
750750
return cut
751751
}
752752

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 {
754754
// 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)
757757
agentNodeSuffix := fmt.Sprintf(`] coder_agent.%s (expand)"`, agent.Name)
758758

759759
// Traverse the graph to check if the coder_<resource_type> depends on coder_agent.
760760
for _, dst := range graph.Edges.SrcToDsts {
761761
for _, edges := range dst {
762762
for _, edge := range edges {
763-
if strings.HasSuffix(edge.Src, appNodeSuffix) &&
763+
if strings.HasSuffix(edge.Src, resourceNodeSuffix) &&
764764
strings.HasSuffix(edge.Dst, agentNodeSuffix) {
765765
return true
766766
}
@@ -770,8 +770,8 @@ func dependsOnAgent(graph *gographviz.Graph, agent *proto.Agent, appAgentID stri
770770
return false
771771
}
772772

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
775775
}
776776

777777
type graphResource struct {

0 commit comments

Comments
 (0)