MCPcopy Create free account
hub / github.com/cloudbase/garm / GetEntityPool

Method GetEntityPool

database/sql/pools.go:349–366  ·  view source on GitHub ↗
(_ context.Context, entity params.ForgeEntity, poolID string)

Source from the content-addressed store, hash-verified

347}
348
349func (s *sqlDatabase) GetEntityPool(_ context.Context, entity params.ForgeEntity, poolID string) (params.Pool, error) {
350 preloadList := []string{
351 "Tags",
352 "Instances",
353 "Enterprise",
354 "Enterprise.Endpoint",
355 "Organization",
356 "Organization.Endpoint",
357 "Repository",
358 "Repository.Endpoint",
359 "Template",
360 }
361 pool, err := s.getEntityPool(s.conn, entity.EntityType, entity.ID, poolID, preloadList...)
362 if err != nil {
363 return params.Pool{}, fmt.Errorf("fetching pool: %w", err)
364 }
365 return s.sqlToCommonPool(pool)
366}
367
368func (s *sqlDatabase) DeleteEntityPool(_ context.Context, entity params.ForgeEntity, poolID string) (err error) {
369 entityID, err := uuid.Parse(entity.ID)

Callers

nothing calls this directly

Calls 2

getEntityPoolMethod · 0.95
sqlToCommonPoolMethod · 0.95

Tested by

no test coverage detected