sl1pm4t / k2tf

Kubernetes YAML to Terraform HCL converter
Mozilla Public License 2.0
1.19k stars 107 forks source link

Update terraform kubernetes provider dependency to 1.6.2 and adapt code #11

Closed pdecat closed 5 years ago

pdecat commented 5 years ago

This PR updates terraform kubernetes provider dependency to 1.6.2.

Code needed an adaptation as, the mode and default_mode attributes of volume source blocks are now mandatorily a string representation of an octal value with a leading zero, cf.:

-https://github.com/terraform-providers/terraform-provider-kubernetes/blame/v1.6.2/CHANGELOG.md#L16

pdecat commented 5 years ago

Without the code adaptation, tests fail:

# go test
4:44PM Warn | excluding attribute - not found in Terraform schema           attr=kubernetes_pod.spec.toleration field=Pod.Spec.Tolerations name=node_exporter_7fth_7 type=kubernetes_pod
4:44PM Warn | excluding attribute - not found in Terraform schema           attr=kubernetes_pod.spec.toleration field=Pod.Spec.Tolerations name=node_exporter_7fth_7 type=kubernetes_pod
4:44PM Warn | excluding attribute - not found in Terraform schema           attr=kubernetes_pod.spec.toleration field=Pod.Spec.Tolerations name=node_exporter_7fth_7 type=kubernetes_pod
4:44PM Warn | excluding attribute - not found in Terraform schema           attr=kubernetes_pod.spec.toleration field=Pod.Spec.Tolerations name=node_exporter_7fth_7 type=kubernetes_pod
--- FAIL: TestWriteObject (0.44s)
    --- FAIL: TestWriteObject/deployment (0.16s)
        hcl_writer_test.go:133: Validation Error: 0> spec.0.template.0.spec.0.volume.0.config_map.0.default_mode: value 420 should start with '0' (octal numeral)
    --- FAIL: TestWriteObject/podNodeExporter (0.09s)
        hcl_writer_test.go:133: Validation Error: 0> spec.0.volume.0.secret.0.default_mode: value 420 should start with '0' (octal numeral)
FAIL
exit status 1
FAIL    github.com/sl1pm4t/k2tf 0.491s
sl1pm4t commented 5 years ago

Thanks @pdecat