HomeClusterLabs Projects

Fix: libcrmcommon: Elements should never match if IDs differ

Description

Fix: libcrmcommon: Elements should never match if IDs differ

This fixes a regression introduced by bb20fd9, which broke the pcs tag
update command in some cases. Suppose we have three resources named d1,
d2, and d3. Then we can have the following scenario:

\# pcs tag create aaa d1 d2
\# pcs tag update aaa add d3 --before d2 remove d1
Error: Unable to update cib
Call failed: Application of update diff failed

This was due to the following patchset being produced:

<diff format="2">

<change operation="modify" path="/cib/configuration/tags/tag[@id='aaa']/obj_ref[@id='d3']">
  <change-list>
    <change-attr name="id" operation="set" value="d3"/>
  </change-list>
  <change-result>
    <obj_ref id="d3"/>
  </change-result>
</change>

</diff>

As of this commit, this change is instead treated as a deletion of the
obj_ref with id="d1" and a creation of an obj_ref with id="d3".

I suspect this will have minor, corner-case effects on how some ACLs
apply, but I think we can ignore this.

Signed-off-by: Reid Wahl <nrwahl@protonmail.com>

Details

Provenance
nrwahl2Authored on Wed, May 14, 5:26 AM
Parents
rPbee943b16727: Doc: various: Update some copyrights that were missed by earlier commits
Branches
Unknown
Tags
Unknown