-
Notifications
You must be signed in to change notification settings - Fork 31
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
field name conflicts during lookups #294
Comments
Interestingly, I am not getting a collision when using file.directory even though it also shares a field named Destination. Maybe related to the different implementation of file.directory described in issue #292? samples/fieldNameNoCollision.hcl: param "filename" {
default = "hello.txt"
}
file.directory "tmp-dir" {
destination = "/tmp/hello"
create_all = true
}
file.content "hello" {
destination = "{{param `filename`}}"
content = "hello"
}
file.mode "hello-mode" {
destination = "{{param `filename`}}"
mode = 0777
}
file.content "hello-log" {
destination = "{{param `filename`}}.log"
content = <<EOF
wrote {{lookup `file.content.hello.destination`}}
in dir {{lookup `file.directory.tmp-dir.destination`}}
EOF
} $ ./converge plan --local samples/fieldNameNoCollision.hcl
2016-09-22T09:01:04-04:00 |INFO| serving addr=:47740 component=rpc
2016-09-22T09:01:04-04:00 |WARN| skipping module verification component=client
2016-09-22T09:01:04-04:00 |INFO| got status component=client file=samples/fieldNameNoCollision.hcl id=root/param.filename run=STARTED stage=PLAN
2016-09-22T09:01:04-04:00 |INFO| got status component=client file=samples/fieldNameNoCollision.hcl id=root/file.directory.tmp-dir run=STARTED stage=PLAN
2016-09-22T09:01:04-04:00 |INFO| got status component=client file=samples/fieldNameNoCollision.hcl id=root/file.content.hello run=STARTED stage=PLAN
2016-09-22T09:01:04-04:00 |INFO| got status component=client file=samples/fieldNameNoCollision.hcl id=root/file.mode.hello-mode run=STARTED stage=PLAN
2016-09-22T09:01:04-04:00 |INFO| got status component=client file=samples/fieldNameNoCollision.hcl id=root/file.content.hello-log run=STARTED stage=PLAN
2016-09-22T09:01:04-04:00 |INFO| got status component=client file=samples/fieldNameNoCollision.hcl id=root run=STARTED stage=PLAN
root/file.directory.tmp-dir:
Messages:
Has Changes: yes
Changes:
/tmp/hello: "<absent>" => "<present>"
root/file.content.hello:
Messages:
hello.txt: File is missing
Has Changes: yes
Changes:
hello.txt: "<file-missing>" => "hello"
root/file.mode.hello-mode:
Messages:
"hello.txt" does not exist
Has Changes: yes
Changes:
hello.txt: "----------" => "-rwxrwxrwx"
root/file.content.hello-log:
Messages:
hello.txt.log: File is missing
Has Changes: yes
Changes:
hello.txt.log:
before:
<file-missing>
after:
wrote hello.txt
in dir /tmp/hello
Summary: 0 errors, 4 changes |
I'll look into it a bit this afternoon but I suspect that you're exactly right- because we can't pull the fields out of an interface there are no fields to actually collide. |
fixed by #301 |
Doing lookups across multiple resources that share a field name results in error like:
Repro below:
samples/fieldNameCollision.hcl:
The text was updated successfully, but these errors were encountered: