-
Notifications
You must be signed in to change notification settings - Fork 301
Conversation
TODO:
|
I think this is ready for the first pass of reviews. |
I haven't looked too far into the actual code, but I wanted to share some high-level feedback since this is likely to change some things around: I'd like to see the PATCH endpoint implemented using JSON patch [0] rather than a custom request format. Additionally, we should consider implementing the PATCH at the root of the machines collection rather than per-machine. What utility does the TTL on a specific key provide? |
Switching to JSONPatch is easy enough as is moving the PATCH at the root level to allow multiple machines to be updated at once. I'll have the changes made in a couple of days. The original idea was to use it as kind of a health check, a process could check a node to see if it was suitable for a specific type of job and set the TTL'ed metadata. Furthur thoughts make it seem like the TTL idea is half baked / gold plating and maybe doesn't deserve to live, particularly with the new request format. |
@epipho I do like the idea, but I'm not sure if we should try to squeeze it in right now. |
|
Removing WIP. Ready for initial review and comments. |
How do I test the dynamic metadata? |
@@ -39,6 +39,8 @@ type Registry interface { | |||
SetUnitTargetState(name string, state job.JobState) error | |||
SetMachineState(ms machine.MachineState, ttl time.Duration) (uint64, error) | |||
UnscheduleUnit(name, machID string) error | |||
UpdateMachineMetadata(machID string, key string, value string) error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's call this SetMachineMetadata
, since Update
can mean the key must already exist in some contexts.
And there's no need to respecify string
three times, just use SetMachineMetadata(machID, key, value string)
@epipho In addition to the inline comments, I have a concern about how the metadata is initially making it into etcd. Machines leave and rejoin the cluster frequently, so metadata that was manually added by someone through etcd will get blown away. I wonder if the metadata published by a given machine should be managed independently from the metadata added through etcd? I think it makes sense for metadata manually added through etcd directly should persist until it is manually removed. |
@bcwaldon Thank you for taking the time to do a very thorough review. I will address all the small stuff this weekend. As for your question above: Wouldn't that be true today since a machine leaving the cluster removes the /machineid/object value that currently holds the metadata? I'm not sure how to best handle your request, I outlined a few possibilities below.
I worry that separating the metadata will be confusing as some will be able to be manipulated via the api and some will not. Of all the suggestions outlined I like 3, treating the configured values as defaults if the machine has never been seen before but leaving it untouched otherwise. |
@epipho It's not clear to me how it should work, so I'd like to get an opinion from @jonboulle on this. |
1c6f9b7
to
70a739d
Compare
+1 ! |
@epipho @bcwaldon @jonboulle What's the status on this? |
bump |
👍 |
It has been a while since this issue has seen some activity. |
14580b0
to
63b20dc
Compare
Hi @epipho, I've been running your code for a month now and it works just fine. Thanks for your contribution! |
There's one point I was wondering about lately: the inability to set a property with an empty value. Aren't empty properties valid if configured via |
23d4b13
to
6fb1256
Compare
54409ab
to
a1a21b8
Compare
Just a short note: |
I can definitely rebase the code for a start.
|
Well, easier said than done, not being a GitHub expert... |
@dalbani Yes, please create a new PR. That would be appropriate, as the original author doesn't seem to be active any more. I'll try to review & test that next week. |
I have rebased on top of master, instead of merging, and created the new PR #1642. |
Closed in favor of #1642. Thanks. |
Updated 2/28/2015
Known Issues: