From b72aa29e7269b60a2db273283bd65318e67e44d9 Mon Sep 17 00:00:00 2001 From: n313893254 Date: Thu, 24 Jan 2019 18:44:47 +0800 Subject: [PATCH] UI upgrade button didn't work for catalog apps https://github.com/rancher/rancher/issues/17573 --- lib/shared/addon/utils/parse-externalid.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/shared/addon/utils/parse-externalid.js b/lib/shared/addon/utils/parse-externalid.js index 9c8f5c485..878e2e286 100644 --- a/lib/shared/addon/utils/parse-externalid.js +++ b/lib/shared/addon/utils/parse-externalid.js @@ -117,8 +117,16 @@ export function parseHelmExternalId(externalId) { }); } - out.templateId = `${ out.catalog }-${ out.template }`; - out.templateVersionId = `${ out.catalog }-${ out.template }-${ out.version }`; + let catalog = out.catalog + + if ( catalog.indexOf('/') !== -1 ) { + catalog = catalog.replace('/', ':'); + } else { + catalog = `cattle-global-data:${ catalog }`; + } + + out.templateId = `${ catalog }-${ out.template }`; + out.templateVersionId = `${ catalog }-${ out.template }-${ out.version }`; return out; }