consul/command/resource
R.B. Boyer 5146810acc
cli: do not hide the resource HCL parsing error and replace it with a JSON error (#19107)
We serially attempt to decode resources in the consul resource apply command
using HCL and then falling back on JSON. This causes the HCL errors to be 
dropped completely in the case where the HCL decode failed due to a typo 
instead of it actually being JSON instead.

This PR proposes sniffing to see if the first non-whitespace character in the 
input is { and if so treat it as JSON, otherwise as HCL and not 
double-decode on error.
2023-10-11 11:37:50 -05:00
..
apply mesh: rename Upstreams and UpstreamsConfiguration to Destinations* (#18995) 2023-09-25 12:03:45 -06:00
client NET-5600/container-test-acl-enabled (#18887) 2023-10-03 10:55:31 -04:00
delete feat: remove resource api client from api module (#18984) 2023-09-22 16:32:08 -04:00
list feat: remove resource api client from api module (#18984) 2023-09-22 16:32:08 -04:00
read feat: remove resource api client from api module (#18984) 2023-09-22 16:32:08 -04:00
testdata mesh: rename Upstreams and UpstreamsConfiguration to Destinations* (#18995) 2023-09-25 12:03:45 -06:00
helper.go cli: do not hide the resource HCL parsing error and replace it with a JSON error (#19107) 2023-10-11 11:37:50 -05:00
helper_test.go Add CLI support for json (#18991) 2023-09-22 20:51:18 +00:00
resource.go Net-4292/list command (#18649) 2023-09-11 10:06:00 -04:00