breser / git2consul

Mirrors the contents of a git repository into Consul KVs.
Other
763 stars 164 forks source link

git2consul is not converting .json file to KV entry in consul #176

Open ksachdeva11 opened 6 years ago

ksachdeva11 commented 6 years ago

My test.json looks something like this :

{
  "url":"http://127.0.0.1:80",
  "web.host1": "xyz.com",
  "web.host2": "abc.com"
}

When I run git2consul, it just blindly puts this value in consul with test.json as key name and the content pasted above as value.

Should it not create a key names like test/url, test/web.host1, test/web.host2 and put values like http://127.0.0.1:80, xyz.com, abc.com under those key names?

Am I doing something wrong?

Attached consul screenshot below :

screen shot 2018-03-26 at 4 10 01 pm

Thanks!

ksachdeva11 commented 6 years ago

Ok, I was able to get it working by setting expand_keys as true in the config. But the path looks like sample_configuration/master/test.json/url.

Is there a way we can get rid of .json from the above path ?

stevenscg commented 6 years ago

@ksachdeva11 Try adding ignore_file_extension: true to your configuration.

joydeep281992 commented 3 years ago

@ksachdeva11 I am facing the initial problem you have described. I am not sure where you are adding the expand_keys parameter. I tried as bellow: { "url":"http://127.0.0.1:80", "web.host1": "xyz.com", "web.host2": "abc.com", "ignore_file_extension": "true", "expand_keys": "true" } It added the entire json to the KV as your initial problem described. Can you please help me troubleshoot this ?