-
Notifications
You must be signed in to change notification settings - Fork 302
Conversation
Recursive: true, | ||
} | ||
resp, err := r.kAPI.Get(r.ctx(), key, opts) | ||
if err != nil { |
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.
you don't return err
so this checking serves no purpose - unless we do want to return an error from this function.
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.
Done.
@@ -254,7 +266,7 @@ func dirToHeartbeat(dir *etcd.Node) (heartbeat string) { | |||
// getUnitFromObject takes a *etcd.Node containing a Unit's jobModel, and | |||
// instantiates and returns a representative *job.Unit, transitively fetching the | |||
// associated UnitFile as necessary |
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.
Document what unitFunc
does. The name unitHashLookupFunc
might make more sense.
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.
Done.
0134d24
to
efbecf8
Compare
Addressed comments. Rebased on |
func (r *EtcdRegistry) getAllUnitsHashMap() (map[string]*unit.UnitFile, error) { | ||
key := r.prefixed(unitPrefix) | ||
opts := &etcd.GetOptions{ | ||
Recursive: true, |
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.
please add Quorum: true
, which was recently added to github.com/coreos/etcd/client
.
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.
Will do. But out of curiosity, what is the canonical etcd Go client?
https://github.com/coreos/go-etcd
or https://github.com/coreos/etcd/client?
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.
Done.
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.
fwiw, etcd/client is now the canonical client, and go-etcd is deprecated
efbecf8
to
5bf8532
Compare
Done, PTAL :) |
5bf8532
to
96f7d67
Compare
@mischief Everthing is fixed, and rebase on latest master. |
@mischief, can you take a look at this again? Together with the |
return r.unitFromEtcdNode(hash, resp.Node) | ||
} | ||
|
||
// getAllUnitsHashMap retrieves from the Registry all Units and returns a map of hash to Unit |
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.
nit, s/Unit/UnitFile/g
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.
Done.
@mwitkow-io A few small comments for you; lgtm after that, thanks! |
Damn, this PR got drawned in a chunk of emails after vacation. Will update in a sec. |
96f7d67
to
091846e
Compare
@jonboulle, @mischief PTAL. Again, apologies for the late response. |
Landing via #1376 |
No description provided.