(_ context.Context, scalesetID uint, outdatedOnly bool)
| 66 | } |
| 67 | |
| 68 | func (s *sqlDatabase) ListScaleSetInstances(_ context.Context, scalesetID uint, outdatedOnly bool) ([]params.Instance, error) { |
| 69 | ret, err := s.listInstancesBatched(func(query *gorm.DB) *gorm.DB { |
| 70 | q := query.Where("scale_set_fk_id = ?", scalesetID) |
| 71 | if outdatedOnly { |
| 72 | q = q.Where("instances.generation < (SELECT scale_sets.generation FROM scale_sets WHERE scale_sets.id = instances.scale_set_fk_id)") |
| 73 | } |
| 74 | return q |
| 75 | }) |
| 76 | if err != nil { |
| 77 | return nil, fmt.Errorf("failed to list scaleset instances: %w", err) |
| 78 | } |
| 79 | return ret, nil |
| 80 | } |
nothing calls this directly
no test coverage detected