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)
| 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. |
| 531 | func (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. |
no test coverage detected