Preload missing resources

There are some inconsistencies in the way the API returns some
values for pools and scale sets. This is due to not preloading
the appropriate relations.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
This commit is contained in:
Gabriel Adrian Samfira 2025-08-12 09:15:58 +00:00
parent 9f2764f614
commit b2dee1d844
5 changed files with 29 additions and 4 deletions

View file

@ -46,6 +46,7 @@ func (s *sqlDatabase) ListAllPools(_ context.Context) ([]params.Pool, error) {
Preload("Enterprise").
Preload("Enterprise.Endpoint").
Omit("extra_specs").
Omit("status_messages").
Find(&pools)
if q.Error != nil {
return nil, errors.Wrap(q.Error, "fetching all pools")