-
Notifications
You must be signed in to change notification settings - Fork 117
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
Add terraform mapping to k8s provider #2457
Conversation
Does the PR have any schema changes?Looking good! No breaking changes found. |
815b3e9
to
56caba6
Compare
ee9f9f4
to
d68bd83
Compare
With this mapping in place the following terraform:
Get converted to the following TypeScript:
|
That conversion looks good except for the selected resource version. It should use |
Ah cool I wasn't sure because TF had both kubernetes_deployment_v1 and kubernetes_deployment. I wasn't sure if the non versioned one should go to the first version released or the latest. |
I think picking the latest version should generally be safe/backward compatible. Lets do that for now, and can revise if we run into problems. |
cf7aa2b
to
ef81c00
Compare
ef81c00
to
93e0e80
Compare
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.
Changes LGTM, but is there any testing for this?
No, I wasn't sure what the best way to test this was? |
cc @t0yv0 @iwahbe @rquitales for thoughts |
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.
YAML is fast, easy to target and aggressively type checked. HCL -> YAML and then previewing the yaml sounds like a great test.
type TerraformAttributeSchema struct { | ||
} |
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.
type TerraformAttributeSchema struct { | |
} | |
type TerraformAttributeSchema struct {} |
As in |
Why would |
Same reason an aws preview complains if your not yet logged into aws. |
39e6470
to
1e78c5b
Compare
b7c6dc4
to
b03b35c
Compare
This returns a basic mapping description for the terraform converter to map terraform programs using https://registry.terraform.io/providers/hashicorp/kubernetes to our kubernetes provider, even though it's not bridged. I grabbed a list of all terraform kubernetes resources by running `terraform providers schema -json` in a tiny terraform program that just defined a kubernetes provider. I've then hooked that up to gen-kubernetes to do a best guess of mapping everything (well just resources so far) from terraform to our provider. Most things look to map pretty well by convention, but we'll probably need some manual fixups to cover everything (already got one for the "container" to "containers" rename).
b03b35c
to
8923dba
Compare
Proposed changes
This returns a basic mapping description for the terraform converter to map terraform programs using https://registry.terraform.io/providers/hashicorp/kubernetes to our kubernetes provider, even though it's not bridged.
I grabbed a list of all terraform kubernetes resources by running
terraform providers schema -json
in a tiny terraform program that just defined a kubernetes provider. I've then hooked that up to gen-kubernetes to do a best guess of mapping everything (well just resources so far) from terraform to our provider. Most things look to map pretty well by convention, but we'll probably need some manual fixups to cover everything (already got one for the "container" to containers" rename).Related issues (optional)