Update view to return host IDs in a set on set lookup (#1646)

This removes the optional call to the plugin.
This commit is contained in:
Jeff Mitchell authored and GitHub committed 2021-10-29 15:35:06 -04:00
1 parent 6eba8a4787
commit 5e782b6ecc
10 files changed
+206 -206

No files matched your search

@@ -423,7 +423,7 @@ func (s Service) getFromRepo(ctx context.Context, id string) (host.Set, []host.H
if err != nil {
return nil, nil, nil, err
}
hset, hostIds, hsplg, err := repo.LookupSet(ctx, id, host.WithSetMembers(true))
hset, hsplg, err := repo.LookupSet(ctx, id)
if err != nil {
return nil, nil, nil, err
}
@@ -432,7 +432,7 @@ func (s Service) getFromRepo(ctx context.Context, id string) (host.Set, []host.H
}
hs = hset
plg = toPluginInfo(hsplg)
for _, h := range hostIds {
for _, h := range hset.HostIds {
hl = append(hl, &plugin.Host{
Host: &plugstore.Host{
PublicId: h,
@@ -690,7 +690,7 @@ func (s Service) parentAndAuthResult(ctx context.Context, id string, a action.Ty
}
set = ss
case plugin.Subtype:
ps, _, _, err := pluginRepo.LookupSet(ctx, id)
ps, _, err := pluginRepo.LookupSet(ctx, id)
if err != nil {
res.Error = err
return nil, res