Support node label update.

This commit is contained in:
Deyuan Deng
2014-11-15 16:32:59 -05:00
parent 37d2bab7ed
commit cc310e0e71
7 changed files with 85 additions and 3 deletions

View File

@@ -60,6 +60,18 @@ func (r *MinionRegistry) CreateMinion(ctx api.Context, minion *api.Minion) error
return r.Err
}
func (r *MinionRegistry) UpdateMinion(ctx api.Context, minion *api.Minion) error {
r.Lock()
defer r.Unlock()
for i, node := range r.Minions.Items {
if node.Name == minion.Name {
r.Minions.Items[i] = *minion
return r.Err
}
}
return r.Err
}
func (r *MinionRegistry) GetMinion(ctx api.Context, minionID string) (*api.Minion, error) {
r.Lock()
defer r.Unlock()