removeInvertLocked removes a pair of referent and referenced objects from the invert map. It assumes the lock is already held by the caller.
(left string, right string)
| 560 | // removeInvertLocked removes a pair of referent and referenced objects from the invert map. |
| 561 | // It assumes the lock is already held by the caller. |
| 562 | func (r *refObjectMapper) removeInvertLocked(left string, right string) { |
| 563 | l := r.invert[right] |
| 564 | for i, v := range l { |
| 565 | if v == left { |
| 566 | l[i] = l[len(l)-1] |
| 567 | r.invert[right] = l[:len(l)-1] |
| 568 | return |
| 569 | } |
| 570 | } |
| 571 | } |
| 572 | |
| 573 | func toFlattenName(key types.NamespacedName) string { |
| 574 | return key.Namespace + "/" + key.Name |