Skip to content
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

hclparser: strip out blocks for json files #1080

Merged
merged 1 commit into from
Apr 29, 2022

Conversation

jedevc
Copy link
Collaborator

@jedevc jedevc commented Apr 27, 2022

Body.JustAttributes cannot distinguish between blocks and attributes for JSON files, so the variable block could be included in the list of attributes returned.

This patch ensures that JSON and HCL files behave the same way by removing all known block types first, from the provided config schema and then from a generated definitions schema.

Fixes #1051

Copy link
Member

@crazy-max crazy-max left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a test for this case?

Body.JustAttributes cannot distinguish between blocks and attributes for
JSON files, so the variable block could be included in the list of
attributes returned.

This patch ensures that JSON and HCL files behave the same way by
removing all known block types first, from the provided config schema
and then from a generated definitions schema.

Fixes docker#1051

Signed-off-by: Justin Chadwell <[email protected]>
Copy link
Member

@crazy-max crazy-max left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tonistiigi tonistiigi merged commit 9cdd837 into docker:master Apr 29, 2022
@jedevc jedevc deleted the issue-1051 branch April 29, 2022 08:21
@crazy-max crazy-max added this to the v0.8.3 milestone Jun 5, 2022
@crazy-max crazy-max modified the milestones: v0.8.3, v0.9.0 Jul 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Docker buildx bake panics with empty variable in JSON file
3 participants