Preload more info for entity pools
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
This commit is contained in:
parent
e79a5c1d50
commit
9ef4566cae
1 changed files with 11 additions and 1 deletions
|
|
@ -343,7 +343,17 @@ func (s *sqlDatabase) CreateEntityPool(ctx context.Context, entity params.ForgeE
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *sqlDatabase) GetEntityPool(_ context.Context, entity params.ForgeEntity, poolID string) (params.Pool, error) {
|
func (s *sqlDatabase) GetEntityPool(_ context.Context, entity params.ForgeEntity, poolID string) (params.Pool, error) {
|
||||||
pool, err := s.getEntityPool(s.conn, entity.EntityType, entity.ID, poolID, "Tags", "Instances")
|
preloadList := []string{
|
||||||
|
"Tags",
|
||||||
|
"Instances",
|
||||||
|
"Enterprise",
|
||||||
|
"Enterprise.Endpoint",
|
||||||
|
"Organization",
|
||||||
|
"Organization.Endpoint",
|
||||||
|
"Repository",
|
||||||
|
"Repository.Endpoint",
|
||||||
|
}
|
||||||
|
pool, err := s.getEntityPool(s.conn, entity.EntityType, entity.ID, poolID, preloadList...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return params.Pool{}, fmt.Errorf("fetching pool: %w", err)
|
return params.Pool{}, fmt.Errorf("fetching pool: %w", err)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue