MCPcopy Index your code
hub / github.com/rilldata/rill / Get

Method Get

runtime/controller.go:423–439  ·  view source on GitHub ↗

Get returns a resource by name. Soft-deleted resources (i.e. resources where DeletedOn != nil) are not returned.

(ctx context.Context, name *runtimev1.ResourceName, clone bool)

Source from the content-addressed store, hash-verified

421// Get returns a resource by name.
422// Soft-deleted resources (i.e. resources where DeletedOn != nil) are not returned.
423func (c *Controller) Get(ctx context.Context, name *runtimev1.ResourceName, clone bool) (*runtimev1.Resource, error) {
424 ctx, span := tracer.Start(ctx, "Controller.Get", trace.WithAttributes(attribute.String("instance_id", c.InstanceID), attribute.String("kind", name.Kind), attribute.String("name", name.Name)))
425 defer span.End()
426 if err := c.checkRunning(); err != nil {
427 return nil, err
428 }
429 if ctx.Err() != nil {
430 return nil, ctx.Err()
431 }
432 c.lock(ctx, true)
433 defer c.unlock(ctx, true)
434
435 // We don't return soft-deleted resources, unless the lookup is from the reconciler itself (which may be executing the delete).
436 withDeleted := c.isReconcilerForResource(ctx, name)
437
438 return c.catalog.get(name, withDeleted, clone)
439}
440
441// List returns a list of resources of the specified kind.
442// If kind is empty, all resources are returned.

Callers

nothing calls this directly

Calls 7

checkRunningMethod · 0.95
lockMethod · 0.95
unlockMethod · 0.95
StringMethod · 0.65
ErrMethod · 0.65
getMethod · 0.45

Tested by

no test coverage detected