Fix scraping Refs from attributes containing lists #441
+452
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of your changes
Scraping does not handle
TupleConsExpr
when parsing example HCL code from Terraform documentation.Example 1):
Does not add:
To metadata as it should since the reference is contained in a list.
With this patch it's correctly scraped and adds a ref. Building
provider-upjet-gcp
with this changeproduces the expected
examples-generated/binaryauthorization/v1beta2/policy.yaml
with this diff compared to without this change.
Fixes #349
I have:
make reviewable
to ensure this PR is ready for review.Addedbackport release-x.y
labels to auto-backport this PR if necessary.How has this code been tested
By updating the unit test in
meta_test.go
and rebuildingprovider-upjet-gcp
(rickard-von-essen/provider-upjet-gcp@f162f83)