Comments (14)
+1
We're currently looking into using git2consul as well and the expand_keys mode with the json file would work great for us. The problem is that the .json extension included in the folder name would change our current set up and we would have to update all the consul-templated files in various environments.
Would be great to have the possibility to remove the file extension or file name as jonathannegrin mentioned.
from git2consul.
+1
For our purpose, the filename has no sense in K/V.
Remove filename will be a great option!
from git2consul.
what should happen when we have more than one file in the expand key mode? they will be merged?
from git2consul.
I have added pull request #84 to solve this case.
from git2consul.
I think this is working great for me, with one caveat. When ignore_file_extension is turned on:
- Folders that use dots (e.g. test.folder) are trimmed in Consul (e.g. /test/ instead of /test.folder/)
- Files sans extensions were loaded, now you need to add e.g. "test.txt" extension otherwise they're not pulled in.
Anyone else confirm this? I can work around both, but thought they were worth pointing out.
from git2consul.
@gjonespf extension removal operation is applied on file names only. Let say that, you have /test.folder/application.properties
, file name is fetched first that application.properties
and then it is splitted by dot [application, properties]
, and then last item is removed [application]
and appended to final path again. Maybe if you provide more concrete example input and output for your case, I can help you further.
from git2consul.
@huseyinbabal will have to retest, as the testcase I just trialled seems to support what you're saying regarding folders. Files without an extension are definitely not read once you turn on the flag, however - and pretty sure they were previously. Example project:
https://github.com/gjonespf/docker-proxy-test
This file without an extension:
https://github.com/gjonespf/docker-proxy-test/blob/master/cfg/filewithoutext
Isn't loaded into consul, however if you rename it to e.g. filewithoutext.txt it gets loaded. Not sure if this is intended or not.
PS: Don't get me wrong, it's an awesome feature 👍
from git2consul.
@gjonespf actually, you have found a possible bug 😄 When you look at here you will see the logic of ignoring file extensions. However, for this project, always file extensions are expected (when I look at test cases in test folder). Project owner or this community maynot accept handling files without extensions. I have suggested a feature before, and they are rejected with meaningful reasons although it is a good feature. To sum up, If everybody is ok for adding exception for files without extensions, we are good to go. Thanks for pointing out 😄
from git2consul.
@huseyinbabal hah, I think I see the issue 😄 If I get time, I'll have to test out a fix. But yeah, not a problem for me as I can work around, but thought I'd mention it. It's something that was actually working previously, so may be worth documenting that extensions are always expected. The PR you've linked is a different thing again, but agree it's a good feature, though hard to simplify/make work without config (which is how I'd suggest it needs to work).
from git2consul.
So is the documentation wrong? I see the "ignore_file_extension" is listed as an available config. But when I set it to true, the file name is not getting ignored.
Fyi, I'm running git2consul as a docker container. [cimpress/git2consul:latest]
from git2consul.
@dtmistry it's certainly working for me, and I'm using it in a container also (though I'm using a custom build for https://github.com/gjonespf/docker-proxy-test). The KV folder names have the extensions removed - this is what you're expecting?
from git2consul.
@gjonespf Yeah I think its the docker image I'm using for git2consul. I see your image using the version 0.12.12. I'll switch to that and test
from git2consul.
Just wanted to chime in on this. docker-git2consul is built against 0.12.10. I'll get it updated, but feel free to use @gjonespf's image to get you unblocked :)
from git2consul.
@dtmistry the Docker image has been updated to 0.12.12 (latest). 0.12.11 is also available if you do need that for any reason.
from git2consul.
Related Issues (20)
- Git2consul Generates PUT GET every 2 seconds on local agent. Why is that?
- How to configure parameters to use consul with HTTPS? HOT 1
- Problem synchronizing binary files
- git2consul is not converting .json file to KV entry in consul HOT 3
- git2consul problem does not cause Docker container to exit HOT 4
- Project status, new official fork? HOT 6
- Getting [Error: consul: kv.get: connect ECONNREFUSED] HOT 1
- Update of git files trigger unwanted delete of similar key name in consul
- support unix socket?
- files in git not within source_root forcing check_pending to setLastProcessedRef HOT 1
- Files not in source_root are killing my consul API. HOT 1
- support_tags should have option for "true", "false", and "read_once"
- git2consul not importing list in yaml HOT 1
- Git2Consul tool not supported for Google Cloud Run
- Windows - running example sync content of git2consul.json intro Consul KV
- readme - link to gitlab docs is broken
- a key for an annotation with slash in the name
- Is there a way to run git2consul as a CLI tool and not as a service? HOT 2
- panic: runtime error: invalid memory address or nil pointer dereference
- reference not found error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from git2consul.