Add DB changes for host, set members, and host addresses for plugins. (#1584)
* Add DB changes for host, set members, and host addresses for plugins. * Add priority, address review feedback, update tests, naming, protos Co-authored-by: Jeff Mitchell <jeffrey.mitchell@gmail.com> Co-authored-by: Michael Gaffney <mgaffney@users.noreply.github.com>
This commit is contained in:
26 files changed
+2341
-352
No files matched your search
@@ -87,11 +87,6 @@ func (r *Repository) CreateSet(ctx context.Context, scopeId string, s *HostSet,
|
||||
}
|
||||
}
|
||||
|
||||
oplogWrapper, err := r.kms.GetWrapper(ctx, scopeId, kms.KeyPurposeOplog)
|
||||
if err != nil {
|
||||
return nil, nil, errors.Wrap(ctx, err, op, errors.WithMsg("unable to get oplog wrapper"))
|
||||
}
|
||||
|
||||
var preferredEndpoints []interface{}
|
||||
if s.PreferredEndpoints != nil {
|
||||
preferredEndpoints = make([]interface{}, 0, len(s.PreferredEndpoints))
|
||||
@@ -104,6 +99,11 @@ func (r *Repository) CreateSet(ctx context.Context, scopeId string, s *HostSet,
|
||||
}
|
||||
}
|
||||
|
||||
oplogWrapper, err := r.kms.GetWrapper(ctx, scopeId, kms.KeyPurposeOplog)
|
||||
if err != nil {
|
||||
return nil, nil, errors.Wrap(ctx, err, op, errors.WithMsg("unable to get oplog wrapper"))
|
||||
}
|
||||
|
||||
var returnedHostSet *HostSet
|
||||
_, err = r.writer.DoTx(
|
||||
ctx,
|
||||
@@ -185,6 +185,7 @@ func (r *Repository) LookupSet(ctx context.Context, publicId string, opt ...host
|
||||
setToReturn := sets[0]
|
||||
var hostIdsToReturn []string
|
||||
|
||||
// FIXME: change to use the database
|
||||
if plg != nil && opts.WithSetMembers {
|
||||
cat, err := r.getCatalog(ctx, setToReturn.GetCatalogId())
|
||||
if err != nil {
|
||||
|
||||
Reference in new issue
Block a user