Comments (7)
Both forms can be supported at the same time:
I like where you're going with the overall concept here but I think supporting two different field names is inelegant. I'd love if we could do something like what the Docker folks did with the CMD
and ENTRYPOINT
Dockerfile stanzas, where they were able to parse both "/usr/bin/my/health"
and ["/usr/bin/my/health", "--with", "some", "-args"]
.
The typical way to do this would be to deserialize the JSON into map[string][]json.RawMessage
, parse the pieces we need, and then complete serialization of the nested ServiceConfig
and BackendConfig
structs (ref http://mattyjwilliams.blogspot.com/2013/01/using-go-to-unmarshal-json-lists-with.html, in the "option C" for an example of how this could be done). This means the code that parses the configuration will be less efficient but honestly we only parse it once so if it's mildly hairy that's fine as long as it's well-tested.
If we weren't going to do that, then I'd say we just break backwards compat (this is still marked alpha) and use a JSON array that will sometimes be a one-argument array. But if we can make the former work that'd be ideal.
from containerpilot.
I should probably point out that we'll probably need to do pre-processing via json.RawMessage
to support #16 anyways, so it might be a good idea to get the scaffolding in place to support it sooner rather than later.
from containerpilot.
@tgross I agree. Originally I wanted to do something like you described (supporting both arrays and strings) but I wasn't sure how to. Thanks for the reference. I'll revisit this tonight and see if I come up with something.
from containerpilot.
@tgross I've implemented the enhancement as suggested. I'm not sure how you want to handle #16 though - since it kind of seems like the implementation strategy is still up in the air.
Also, it seemed like it would be good to support the string/array for interfaces as well - so if you only want to provide 1 interface, it doesn't need to be wrapped in an array.
from containerpilot.
I'm not sure how you want to handle #16 though - since it kind of seems like the implementation strategy is still up in the air.
Let's not worry about that for now; what you have here provides the places to hook-in for whomever is going to implement that nicely.
from containerpilot.
This has been merged and will be in the next release (presumably 0.0.5). Thanks @justenwalker!
from containerpilot.
Released in https://github.com/joyent/containerbuddy/releases/tag/0.0.5
from containerpilot.
Related Issues (20)
- Stability issues with signal events under SmartOS/LX HOT 2
- [Question]How to disable default metrics and only response custom defined metrics? HOT 5
- Building inside a docker container HOT 2
- SmartOS and LX brand issues with Go 1.9
- Docs incorrectly say 'initialStatus', should be 'initial_status' HOT 2
- Telemetry custom metrics always zero HOT 4
- Run as user per job HOT 5
- Allow for an ADHoc Sending of a signal to a ContainerPilot job. HOT 1
- Project status HOT 3
- Error parsing environment variable in config template
- Unable to execute job HOT 1
- CP ends up ignoring that it's jobs have been killed
- Local build on SmartOS fails due to upstream changes
- 100% CPU Usage
- github url's in documentation
- Documentation Update: docker-compose --scale "change"
- consul with TLS does not read env vars set by -putenv
- Broken link to blog/wordpress-on-autopilot
- Container Pilot process get hung and cannot recover when health check timeouts continues for more than an hour
- Support consul service meta data HOT 5
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 containerpilot.