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

@ -33,8 +33,11 @@ func (s *sqlDatabase) ListAllScaleSets(_ context.Context) ([]params.ScaleSet, er
q := s.conn.Model(&ScaleSet{}).
Preload("Organization").
Preload("Organization.Endpoint").
Preload("Repository").
Preload("Repository.Endpoint").
Preload("Enterprise").
Preload("Enterprise.Endpoint").
Omit("extra_specs").
Omit("status_messages").
Find(&scaleSets)