Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf3fe2a0

Browse files
authored
fix: Use Terraform address to index resource + agent association (#1577)
This fixes resources created from Terraform modules notproperly being associated with an agent.By not using the address, and resource identifiers prefixedwith `module.<name>` would be missed!
1 parent0706c60 commitf3fe2a0

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

‎provisioner/terraform/provision.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -357,11 +357,10 @@ func parseTerraformPlan(ctx context.Context, terraform *tfexec.Terraform, planfi
357357
ifresource.Type=="coder_agent"||resource.Type=="coder_agent_instance" {
358358
continue
359359
}
360-
resourceKey:=strings.Join([]string{resource.Type,resource.Name},".")
361360
resources=append(resources,&proto.Resource{
362361
Name:resource.Name,
363362
Type:resource.Type,
364-
Agents:findAgents(resourceDependencies,agents,resourceKey),
363+
Agents:findAgents(resourceDependencies,agents,resource.Address),
365364
})
366365
}
367366

@@ -498,8 +497,7 @@ func parseTerraformApply(ctx context.Context, terraform *tfexec.Terraform, state
498497
ifresource.Type=="coder_agent"||resource.Type=="coder_agent_instance" {
499498
continue
500499
}
501-
resourceKey:=strings.Join([]string{resource.Type,resource.Name},".")
502-
resourceAgents:=findAgents(resourceDependencies,agents,resourceKey)
500+
resourceAgents:=findAgents(resourceDependencies,agents,resource.Address)
503501
for_,agent:=rangeresourceAgents {
504502
// Didn't use instance identity.
505503
ifagent.GetToken()!="" {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp