-
Notifications
You must be signed in to change notification settings - Fork 19
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
Conflict when adding coder_metadata
with duplicate resouce_id
s
#305
Comments
coder_metadata
in Modulescoder_metadata
with duplicate resouce_id
s
Related: #306 |
The provisioner doesn't currently handle associating All other Terraform resources are returned by the provisioner as containing a list of You can see this if you So to resolve this issue, I'd propose just two changes:
|
I don't think we should merge the dynamic |
1: Sounds like a good solution, just a fair bit more work. EDIT: I don't think 1 is the right move, it would mean we have agent metadata in the UI in two different places, depending on whether it's set in the template, or retrieved dynamically via a command. |
I don't mean we merge the resource "coder_metadata" "module" {
count = data.coder_workspace.me.start_count
resource_id = resource.aws_instnace.id
item {
key = "username"
value = "var.admin_username"
}
item {
key = "password"
value = var.admin_password
sensitive = true
}
}
resource "coder_metadata" "template" {
count = data.coder_workspace.me.start_count
resource_id = resource.aws_instnace.id # note that both use the same reosurce_id
item {
key = "region"
value = data.coder_parameter.region.value
}
item {
key = "instance type"
value = aws_instance.dev.instance_type
}
} We should display a single coder_metadata section and merge the What do you think about it @bpmct? |
Oh I see what you mean, yeah. That's what you suggested originally, I definitely agree that's a good solution. but that doesn't address where |
Yes, maybe we can narrow the scope so as not to support the |
Problem Description
While adding
coder_metadata
blocks inside a module we need to pass the resource_id to link the metadata to. The issue arises when theresource_id
of the instance is linked to an existingcoder_metadata
block in the main template, which causes a conflict and the template fails to build.Attempting to use an alternative identifier, such as
agent_id
, doesn't show metadata on the workspace page.Steps to Reproduce
coder_metadata
block to a module and link it to theresource_id
of an instance.coder_metadata
block in the main template referencing the sameresource_id
.agent_id
instead in the module and note the absence of display metadata.Impact
Next Steps
coder_metadata
to avoid conflicts between module-level and main template declarations when sharing the sameresource_id
. One possible solution is to merge and append the newitem
entries when we detect a conflict inresource_id
.agent_id
does not work withcoder_metadata
.Note
We did allow adding multiple
coder_metadata
with the sameresource_id
. See coder/coder#6517.The text was updated successfully, but these errors were encountered: