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

Example Manifests formatted as JSON in the scraped provider metadata #29

Closed
ulucinar opened this issue Jun 29, 2022 · 2 comments
Closed
Labels
enhancement New feature or request

Comments

@ulucinar
Copy link
Collaborator

What problem are you facing?

As discussed here, the scraped provider metadata document embeds converted (from HCL to JSON) resource example manifests as JSON strings:

...
              manifest: |-
                {
                  "country_code": "US",
                  "data_residency_location": "United States",
                  "display_name": "example-b2c-tenant",
                  "domain_name": "exampleb2ctenant.onmicrosoft.com",
                  "resource_group_name": "example-rg",
                  "sku_name": "PremiumP1"
                }

We can consider embedding them as YAML.

How could Terrajet help solve your problem?

As explained here, we hit some issues while doing so as this requires conversion from JSON to YAML and then back to JSON. Using sigs.k8s.io/yaml as the JSON2YAML convertor and as YAML encoder solves the tab character issue mentioned in that comment, as the sigs.k8s.io/yaml library does not encode the multiline YAML values with a preceding tab char as multiline YAML but rather a quoted (single-line) YAML string with special chars escaped. However, the JSON libraries cannot cope with the embedded map[interface{}]interface{} values by the YAML decoder (when unmarshaling from the provider doc to a map[string]interface{}. We can have a deeper look into this.

@luebken
Copy link

luebken commented Aug 31, 2022

@ulucinar Could you explain what the impact would be? Do we have a idea on these examples would relate and even enhance our current examples from the docs?

@ulucinar
Copy link
Collaborator Author

Let's revisit this if there are parties requesting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants