bake: reject targets inside target blocks#3906
Conversation
dca180b to
1f13238
Compare
|
Gentle ping on this one. It's a small, self-contained fix for #2437: The |
1f13238 to
ff8b61e
Compare
Signed-off-by: Aaron Mark <64331623+amarkdotdev@users.noreply.github.com>
ff8b61e to
2ff20ec
Compare
|
@tonistiigi @crazy-max Gentle ping — rebased on latest Small fix for #2437: Would appreciate a look when you have a moment. |
crazy-max
left a comment
There was a problem hiding this comment.
Thanks for tackling this. I'm not convinced this fully closes #2437 yet.
This patch special-cases one invalid attribute, targets inside a target block, and returns a hard parse error after the normal HCL parse succeeds. That fixes the reproducer from #2437, but the issue thread was also about the broader validation contract, including the earlier concern that strict schema validation could be breaking and the later suggestion to warn instead.
So can we make the intended contract explicit with tests for the relevant bake inputs? At minimum I'd expect coverage showing this behaves correctly for merged files and JSON bake syntax too, since otherwise this is easy to mistake for a complete validation fix when it is really a targeted guard.
Document the targeted guard across HCL, JSON, and merged bake files. Signed-off-by: Aaron Mark <64331623+amarkdotdev@users.noreply.github.com>
|
@crazy-max Fair point — this is intentionally a narrow guard for the #2437 reproducer, not the broader schema validation we discussed in the issue thread. I held off on strict validation given the breaking-change concern you raised there. Pushed
Contract for this PR: |
Summary
Testing
Closes #2437