-
Notifications
You must be signed in to change notification settings - Fork 588
bake: set attribute even if diagnosed as duplicated #1062
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
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.
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. |

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

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?