clone clones a resource such that it is safe to mutate without affecting a cached resource.
(r *runtimev1.Resource)
| 477 | |
| 478 | // clone clones a resource such that it is safe to mutate without affecting a cached resource. |
| 479 | func (c *catalogCache) clone(r *runtimev1.Resource) *runtimev1.Resource { |
| 480 | return proto.Clone(r).(*runtimev1.Resource) |
| 481 | } |
| 482 | |
| 483 | // isCyclic returns true if the resource has cyclic references. |
| 484 | // It must be checked before accessing the resource in c.dag (since cyclic resources are not added to the DAG). |