Preload more info for entity pools

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
This commit is contained in:
Gabriel Adrian Samfira 2025-08-27 09:14:45 +00:00
parent e79a5c1d50
commit 9ef4566cae

View file

@ -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) {
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 {
return params.Pool{}, fmt.Errorf("fetching pool: %w", err)
}