-
Notifications
You must be signed in to change notification settings - Fork 887
fix: Allow nested Terraform resources #1093
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This fixes the dependency tree by adding recursion. It now finds indirect connections and associates it with an agent. An example is attached which surfaced this issue.
Codecov Report
@@ Coverage Diff @@
## main #1093 +/- ##
==========================================
- Coverage 66.53% 66.48% -0.05%
==========================================
Files 255 255
Lines 15671 15675 +4
Branches 152 152
==========================================
- Hits 10426 10421 -5
- Misses 4180 4184 +4
- Partials 1065 1070 +5
Continue to review full report at Codecov.
|
3111ac9
to
4aa794f
Compare
Invoke-WebRequest -Uri ${ACCESS_URL}bin/coder-windows-amd64.exe -OutFile $env:TEMP\sshd.exe | ||
Set-MpPreference -DisableRealtimeMonitoring $true -ExclusionPath $env:TEMP\sshd.exe | ||
$env:CODER_AUTH = "${AUTH_TYPE}" | ||
$env:CODER_URL = "${ACCESS_URL}" | ||
Start-Process -FilePath $env:TEMP\sshd.exe -ArgumentList "agent" -PassThru | ||
`, | ||
Start-Process -FilePath $env:TEMP\sshd.exe -ArgumentList "agent" -PassThru`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🪟🔌🐚
for _, dep := range resourceNode { | ||
var has bool | ||
agent, has := agents[dep] | ||
if !has { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
} | ||
direct[label] = dependencies | ||
label, exists := dependencyNode.Attrs["label"] | ||
if !exists { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
// findAgents recursively searches through resource dependencies | ||
// to find associated agents. Nested is required for indirect | ||
// dependency matching. | ||
func findAgents(resourceDependencies map[string][]string, agents map[string]*proto.Agent, resourceKey string) []*proto.Agent { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to have an upper bound on recursion depth "just in case"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We limit payload file size, so I don't think it'd be possible to bomb it beyond 10mb.
This fixes the dependency tree by adding recursion. It
now finds indirect connections and associates it with
an agent.
An example is attached which surfaced this issue.