Open LightAndLight opened 3 years ago
Could you run k2tf with the --debug flag to see if it logs warnings about these fields. I suspect it's probably not guessing the correct Terraform attribute name and then skipping because it's not found in the Terraform schema.
Only Debug
level logs are produced. There weren't any warnings.
Having the same issue while translating the Vault helm chart - injector-mutating-webhook.yaml loses apiGroups
, apiVersions
and resources
during translation.
objectSelector:
matchExpressions:
- key: app.kubernetes.io/name
operator: NotIn
values:
- injector
also gets translated to
object_selector {
match_expressions {
key = component
operator = "NotIn"
values = ["injector"]
}
}
I'm also suffering this issue trying to convert this configuration.
One-line repro:
yaml="$(curl -s https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.3.0/deploy/static/provider/aws/nlb-with-tls-termination/1.21/deploy.yaml | grep -A 100 'apiVersion: admission')" && echo "${yaml}" && echo "------" && k2tf <<< "${yaml}"
Having the same issue with nginx ingress controller https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.3.1/deploy/static/provider/cloud/deploy.yaml
Any plans to take a look to this?
I'm having exactly the same issue as OP and @auriben - please look into this issue. Thank you.
I'm having the same issue. Any chance this will be fixed in the future?
I ran
k2tf
on this document https://raw.githubusercontent.com/kubernetes/ingress-nginx/ingress-nginx-2.11.3/deploy/static/provider/cloud/deploy.yaml, which contains this resource definition:but the corresponding Terraform output looks like this:
The
apiGroups
,apiVersions
, andresources
are not translated, but they are required fields which means this is an invalid Terraform configuration.