Repository navigation
bake: set attribute even if diagnosed as duplicated - #1062
Conversation
tonistiigi
left a comment
There was a problem hiding this comment.
Did we try to upstream this?
Could we avoid copying this bunch of code by just providing our own JustAttributes() function that ranges over array and calls internal JustAttributes() for each item.
Add more context to this issue about the actual bake case it addresses and bake tests.
|
@crazy-max do you have a test case here? (sorry, I know this is an older issue) I think there might be an easier way to resolve this using some of the bake refactors recently, but I can't seem to reproduce the issue being discussed - the test from #1025 (comment) fails for different reasons. |
d8fb958 to
fafb234
Compare
fafb234 to
c89b3a1
Compare
This is just for consistency with #1025 so we can merge global attributes like: # c1.hcl
FOO = "abc"
target "app" {
args = {
v1 = "pre-${FOO}"
}
}# c2.hcl
FOO = "def"Which currently gives |
5f3e101 to
5846c05
Compare
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
G601: Implicit memory aliasing in for loop. (gosec) Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
5846c05 to
dfb557b
Compare
Opened an issue on HCL repo and got some feedback hashicorp/hcl#636 (comment). Creating our own implementation like Terraform does looks to be the right way. |
Carry changes from #1025 related to an issue with hcl attributes not set if diagnosed as duplicated: #1025 (comment).
Needs to fork the merge logic from hcl repo. It might be better if hcl exposed its mergedbodies interface. Don't think we should fork the repo and vendor it here with this small change though. Maybe there is a better way?