code: func (p *patcher) applyPatch(_ context.Context, _, currentObject runtime.Object) (objToUpdate runtime.Object, patchErr error) {
  	// Make sure we actually have a persisted currentObject
  	p.trace.Step("About to apply patch")
  	currentObjectHasUID, err := hasUID(currentObject)
  	if err != nil {
  		return nil, err
  	} else if !currentObjectHasUID {
  		objToUpdate, patchErr = p.mechanism.createNewObject()
  	} else {
  		objToUpdate, patchErr = p.mechanism.applyPatchToCurrentObject(currentObject)
  	}
  
  	if patchErr != nil {
  		return nil, patchErr
  	}
  
  	objToUpdateHasUID, err := hasUID(objToUpdate)
  	if err != nil {
  		return nil, err
  	}
  	if objToUpdateHasUID && !currentObjectHasUID {
  		accessor, err := meta.Accessor(objToUpdate)
  		if err != nil {
  			return nil, err
  		}
  		return nil, errors.NewConflict(p.resource.GroupResource(), p.name, fmt.Errorf("uid mismatch: the provided object specified uid %s, and no existing object was found", accessor.GetUID()))
  	}
  
  	if err := checkName(objToUpdate, p.name, p.namespace, p.namer); err != nil {
  		return nil, err
  	}
  	return objToUpdate, nil
  }
docs: // applyPatch is called every time GuaranteedUpdate asks for the updated object,
  // and is given the currently persisted object as input.
  // TODO: rename this function because the name implies it is related to applyPatcher