Github user ahgittin commented on a diff in the pull request:
https://github.com/apache/brooklyn-server/pull/737#discussion_r124508624
--- Diff:
core/src/main/java/org/apache/brooklyn/core/catalog/internal/BasicBrooklynCatalog.java
---
@@ -855,24 +893,50 @@ private boolean attemptType(String key,
CatalogItemType candidateCiType) {
}
// first look in collected items, if a key is given
String type = (String) item.get("type");
- String version = null;
- if (CatalogUtils.looksLikeVersionedId(type)) {
- version = CatalogUtils.getVersionFromVersionedId(type);
- type = CatalogUtils.getSymbolicNameFromVersionedId(type);
- }
+
if (type!=null && key!=null) {
for (CatalogItemDtoAbstract<?,?> candidate:
itemsDefinedSoFar) {
if (candidateCiType == candidate.getCatalogItemType()
&&
(type.equals(candidate.getSymbolicName()) ||
type.equals(candidate.getId()))) {
- if (version==null ||
version.equals(candidate.getVersion())) {
- // matched - exit
- catalogItemType = candidateCiType;
- planYaml = candidateYaml;
- resolved = true;
- return true;
+ // matched - exit
+ catalogItemType = candidateCiType;
+ planYaml = candidateYaml;
+ resolved = true;
+ return true;
+ }
+ }
+ }
+ {
+ // legacy routine; should be the same as above code added
in 0.12 because:
+ // if type is symbolic_name, the type will match below,
and version will be null so any version allowed to match
--- End diff --
yes, should be `above`
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---