Skip to content

Commit

Permalink
Fix missing info in pool list
Browse files Browse the repository at this point in the history
Without preloading the entity we're listing pools for, we don't get that
info when listing pools for a repo/org/enterprise.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
  • Loading branch information
gabriel-samfira committed Mar 14, 2024
1 parent ce3c917 commit b58555b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion database/sql/enterprise.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ func (s *sqlDatabase) FindEnterprisePoolByTags(_ context.Context, enterpriseID s
}

func (s *sqlDatabase) ListEnterprisePools(ctx context.Context, enterpriseID string) ([]params.Pool, error) {
pools, err := s.listEntityPools(ctx, params.EnterprisePool, enterpriseID, "Tags", "Instances", "Instances.Job")
pools, err := s.listEntityPools(ctx, params.EnterprisePool, enterpriseID, "Tags", "Instances", "Enterprise")
if err != nil {
return nil, errors.Wrap(err, "fetching pools")
}
Expand Down
2 changes: 1 addition & 1 deletion database/sql/organizations.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ func (s *sqlDatabase) CreateOrganizationPool(ctx context.Context, orgID string,
}

func (s *sqlDatabase) ListOrgPools(ctx context.Context, orgID string) ([]params.Pool, error) {
pools, err := s.listEntityPools(ctx, params.OrganizationPool, orgID, "Tags", "Instances")
pools, err := s.listEntityPools(ctx, params.OrganizationPool, orgID, "Tags", "Instances", "Organization")
if err != nil {
return nil, errors.Wrap(err, "fetching pools")
}
Expand Down
2 changes: 1 addition & 1 deletion database/sql/repositories.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ func (s *sqlDatabase) CreateRepositoryPool(ctx context.Context, repoID string, p
}

func (s *sqlDatabase) ListRepoPools(ctx context.Context, repoID string) ([]params.Pool, error) {
pools, err := s.listEntityPools(ctx, params.RepositoryPool, repoID, "Tags", "Instances")
pools, err := s.listEntityPools(ctx, params.RepositoryPool, repoID, "Tags", "Instances", "Repository")
if err != nil {
return nil, errors.Wrap(err, "fetching pools")
}
Expand Down

0 comments on commit b58555b

Please sign in to comment.