terraform-provider-kustomization icon indicating copy to clipboard operation
terraform-provider-kustomization copied to clipboard

Trying to apply a job which already exist fails with "JSON parse error"

Open gnuletik opened this issue 2 years ago • 1 comments

The job was not being imported because it did not have the kubectl.kubernetes.io/last-applied-configuration annotation (because of the kubectl replace usage).

It failed with:

github.com/kbst/terraform-provider-kustomize/kustomize.kustomizationResourceUpdate: JSON parse error: unexpected end of JSON input

Would it be possible to have a more simple human readable message?

Thanks for this project!

gnuletik avatar Jun 17 '22 11:06 gnuletik

I'm currently just returning the error from the Go JSON parser. Not optimal, I agree. If somebody wants to take a shot at improving this, I'd happily accept a PR.

pst avatar Jun 18 '22 06:06 pst

The provider returns a more useful message now: https://github.com/kbst/terraform-provider-kustomization/blob/master/kustomize/resource_kustomization.go#L416-L421

pst avatar Jan 03 '23 14:01 pst