Nexus allows multiple instances of a capability to be created, as long as at least one of a certain subset of its properties is unique.
Previously, the CASC plugin would assume that only a single capability of any given type can exist, so would always replace any existing capability of the mathching type, even if it has only just been created by the CASC config itself.
This PR changes that behaviour:
Only capabilities that existed before the CASC configuration was applied are candidates for replacement
If there are multiple existing capabilities of a matching type, a "best match" is found by comparing properties/attribute values
Once a match has been found between an existing capability and a capability config in the CASC, that existing capability will be removed from the candidate pool for matching against any subsequent capability configs defined in the CASC.
If the new pruneCapabilitiesByType config option is specified, any existing capabilities that aren't matched against capability configs will removed. This only applies to capabilities whose type matches at least one capability config in the CASC.
Nexus allows multiple instances of a capability to be created, as long as at least one of a certain subset of its properties is unique.
Previously, the CASC plugin would assume that only a single capability of any given type can exist, so would always replace any existing capability of the mathching type, even if it has only just been created by the CASC config itself.
This PR changes that behaviour:
pruneCapabilitiesByType
config option is specified, any existing capabilities that aren't matched against capability configs will removed. This only applies to capabilities whose type matches at least one capability config in the CASC.