-
Notifications
You must be signed in to change notification settings - Fork 483
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
bake: initial set of composable bake attributes #2758
bake: initial set of composable bake attributes #2758
Conversation
Very incomplete first draft. This requires some changes to the The only changes to |
2a36f74
to
88ff1f4
Compare
88ff1f4
to
4e0ecda
Compare
ceecb9d
to
af7ebbf
Compare
95dc438
to
3f474cc
Compare
I've modified this to include a small fork of the |
3f474cc
to
6947951
Compare
https://github.com/docker/buildx/blob/master/bake/hclparser/merged.go is also a fork from upstream. Maybe we could move it to an
|
6b42716
to
5f76a38
Compare
5f76a38
to
0ac54d6
Compare
This PR is becoming fairly large. There are a few more attributes that have to be migrated to work, but it might be good to review and merge what we have to land this feature. I'm changing this to ready to review while I work on the remaining attributes. |
1ed12f2
to
dcf5387
Compare
dcf5387
to
0ac54d6
Compare
Overall LGTM but still testing other cases like the |
Putting this back to draft for the time being since the variable references don't work. |
0ac54d6
to
ffb9d3d
Compare
Ready for review again. Variable resolution works. The key part is HCL doesn't support the capsule types when resolving variables so there's now code that converts the capsule types to native types when resolving variables. |
ffb9d3d
to
7a06dce
Compare
ba03523
to
4070cb4
Compare
require.Equal(t, []string{"default", "key=path/to/key"}, stringify(c.Targets[0].SSH)) | ||
} | ||
|
||
func TestHCLAttrsCapsuleTypeVars(t *testing.T) { |
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.
Add also cases for
- accessing another target, not just properties of the same target
- using global variables in the object values
- mixing csv and objects (whatever the behavior is just to lock it down)
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.
- array assignment
cache-to = target.app.cache-from
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.
Done.
4070cb4
to
aab3c40
Compare
This allows using either the csv syntax or object syntax to specify certain attributes. This applies to the following fields: - output - cache-from - cache-to - secret - ssh There are still some remaining fields to translate. Specifically ulimits, annotations, and attest. Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
aab3c40
to
3ccbb88
Compare
This allows using either the csv syntax or object syntax to specify
certain attributes.
This applies to the following fields:
There are still some remaining fields to translate. Specifically
ulimits, annotations, and attest.
Related to #438.