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

fix(provisioner): handle multiple agents, apps, scripts and envs#13741

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
mtojek merged 11 commits intomainfrom12949-apps
Jul 3, 2024
Merged
Changes from1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
fix: naming
  • Loading branch information
@mtojek
mtojek committedJul 3, 2024
commit1d2f7977746bf8f343883ada0ea1882f8b1bdea2
12 changes: 6 additions & 6 deletionsprovisioner/terraform/resources.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -750,17 +750,17 @@ func convertAddressToLabel(address string) string {
return cut
}

func dependsOnAgent(graph *gographviz.Graph, agent *proto.Agent,appAgentID string, resource *tfjson.StateResource) bool {
func dependsOnAgent(graph *gographviz.Graph, agent *proto.Agent,resourceAgentID string, resource *tfjson.StateResource) bool {
// Plan: we need to find if there is edge between the agent and the resource.
if agent.Id == "" &&appAgentID == "" {
appNodeSuffix := fmt.Sprintf(`] %s.%s (expand)"`, resource.Type, resource.Name)
if agent.Id == "" &&resourceAgentID == "" {
resourceNodeSuffix := fmt.Sprintf(`] %s.%s (expand)"`, resource.Type, resource.Name)
agentNodeSuffix := fmt.Sprintf(`] coder_agent.%s (expand)"`, agent.Name)

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

// Provision: agent ID andapp ID are present
return agent.Id ==appAgentID
// Provision: agent ID andchild resource ID are present
return agent.Id ==resourceAgentID
}

type graphResource struct {
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp