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

Method UpdateMeta

runtime/controller.go:531–563  ·  view source on GitHub ↗

UpdateMeta updates a resource's meta fields and enqueues it for reconciliation. If called from outside the resource's reconciler and the resource is currently reconciling, the current reconciler will be cancelled first.

(ctx context.Context, name *runtimev1.ResourceName, refs []*runtimev1.ResourceName, owner *runtimev1.ResourceName, paths []string)

Source from the content-addressed store, hash-verified

529// UpdateMeta updates a resource's meta fields and enqueues it for reconciliation.
530// If called from outside the resource's reconciler and the resource is currently reconciling, the current reconciler will be cancelled first.
531func (c *Controller) UpdateMeta(ctx context.Context, name *runtimev1.ResourceName, refs []*runtimev1.ResourceName, owner *runtimev1.ResourceName, paths []string) error {
532 if err := c.checkRunning(); err != nil {
533 return err
534 }
535 if ctx.Err() != nil {
536 return ctx.Err()
537 }
538 c.lock(ctx, false)
539 defer c.unlock(ctx, false)
540
541 if !c.isReconcilerForResource(ctx, name) {
542 c.cancelIfRunning(name)
543 c.enqueue(name)
544 }
545
546 err := c.safeMutateRenamed(name)
547 if err != nil {
548 return err
549 }
550
551 err = c.catalog.updateMeta(name, refs, owner, paths)
552 if err != nil {
553 return err
554 }
555
556 // We updated refs, so it may have broken previous cyclic references
557 ns := c.catalog.retryCyclicRefs()
558 for _, n := range ns {
559 c.enqueue(n)
560 }
561
562 return nil
563}
564
565// UpdateName renames a resource and updates annotations, and enqueues it for reconciliation.
566// If called from outside the resource's reconciler and the resource is currently reconciling, the current reconciler will be cancelled first.

Callers 1

putParserResourceDefMethod · 0.80

Calls 10

checkRunningMethod · 0.95
lockMethod · 0.95
unlockMethod · 0.95
cancelIfRunningMethod · 0.95
enqueueMethod · 0.95
safeMutateRenamedMethod · 0.95
updateMetaMethod · 0.80
retryCyclicRefsMethod · 0.80
ErrMethod · 0.65

Tested by

no test coverage detected