List returns a list of resources of the specified kind. If kind is empty, all resources are returned. Soft-deleted resources (i.e. resources where DeletedOn != nil) are not returned.
(ctx context.Context, kind, path string, clone bool)
| 442 | // If kind is empty, all resources are returned. |
| 443 | // Soft-deleted resources (i.e. resources where DeletedOn != nil) are not returned. |
| 444 | func (c *Controller) List(ctx context.Context, kind, path string, clone bool) ([]*runtimev1.Resource, error) { |
| 445 | ctx, span := tracer.Start(ctx, "Controller.List", trace.WithAttributes(attribute.String("instance_id", c.InstanceID), attribute.String("kind", kind))) |
| 446 | defer span.End() |
| 447 | if err := c.checkRunning(); err != nil { |
| 448 | return nil, err |
| 449 | } |
| 450 | if ctx.Err() != nil { |
| 451 | return nil, ctx.Err() |
| 452 | } |
| 453 | c.lock(ctx, true) |
| 454 | defer c.unlock(ctx, true) |
| 455 | return c.catalog.list(kind, path, false, clone), nil |
| 456 | } |
| 457 | |
| 458 | // SubscribeCallback is the callback type passed to Subscribe. |
| 459 | type SubscribeCallback func(e runtimev1.ResourceEvent, n *runtimev1.ResourceName, r *runtimev1.Resource) |