feat(workers): implement worker service add/set/remove api tags
This commit is contained in:
1 parent
d5633952db
commit
28f53a64b4
15 files changed
+2354
-192
No files matched your search
@@ -711,7 +711,8 @@ func (r *Repository) DeleteWorkerTags(ctx context.Context, workerId string, work
|
||||
return errors.Wrap(ctx, err, op, errors.WithMsg("unable to delete worker tags"))
|
||||
}
|
||||
if rowsDeleted != len(deleteTags) {
|
||||
return errors.New(ctx, errors.MultipleRecords, op, fmt.Sprintf("tags deleted %d did not match request for %d", rowsDeleted, len(tags)))
|
||||
return errors.New(ctx, errors.MultipleRecords, op,
|
||||
fmt.Sprintf("unable to delete specified tag: tags deleted %d did not match request for %d", rowsDeleted, len(tags)))
|
||||
}
|
||||
return nil
|
||||
})
|
||||
|
||||
@@ -153,6 +153,15 @@ func (w *Worker) GetConfigTags() map[string][]string {
|
||||
return tags
|
||||
}
|
||||
|
||||
// GetApiTags returns the api tags which have been set for this worker.
|
||||
func (w *Worker) GetApiTags() map[string][]string {
|
||||
tags := make(map[string][]string)
|
||||
for _, t := range w.apiTags {
|
||||
tags[t.Key] = append(tags[t.Key], t.Value)
|
||||
}
|
||||
return tags
|
||||
}
|
||||
|
||||
// GetLastStatusTime contains the last time the worker has reported to the
|
||||
// controller its connection status. If the worker has never reported to a
|
||||
// controller then nil is returned.
|
||||
|
||||
Reference in new issue
Block a user