diff --git a/charts/node-red/Chart.yaml b/charts/node-red/Chart.yaml index ba2f472c..5e24b172 100644 --- a/charts/node-red/Chart.yaml +++ b/charts/node-red/Chart.yaml @@ -9,7 +9,7 @@ icon: https://nodered.org/about/resources/media/node-red-icon-2.png type: application -version: 0.40.1 +version: 0.40.2 appVersion: 4.1.2 keywords: diff --git a/charts/node-red/README.md.gotmpl b/charts/node-red/README.md.gotmpl index f394c29e..0c802e53 100644 --- a/charts/node-red/README.md.gotmpl +++ b/charts/node-red/README.md.gotmpl @@ -107,9 +107,10 @@ You need to list your flows required 'NODE_MODULES' in the `sidecar.extraNodeMod ```yaml sidecar: extraNodeModules: - - node-red-contrib-xkeys_setunitid - - node-red-contrib-microsoft-teams-tasks - node-red-contrib-json + - node-red-node-mysql@2.0.0 + - @flowfuse/node-red-dashboard + - @flowfuse/node-red-dashboard-2-ui-iframe@1.1.0 ``` To install the node modules successfully, the node red pod needs access to the `npmrc.registry` to download the declaired modules/packages. diff --git a/charts/node-red/scripts/flow_refresh.py b/charts/node-red/scripts/flow_refresh.py index 0a4b5dcb..6e82923b 100644 --- a/charts/node-red/scripts/flow_refresh.py +++ b/charts/node-red/scripts/flow_refresh.py @@ -109,7 +109,13 @@ def main(): for module in EXTRA_NODE_MODULES: if module not in modules_installed: try: - module_name, version = module.rsplit('/', 1)[-1].split('@', 1) if '@' in module else (module, None) + # SPLIT WILL NOT WORK PROBERLY, IF STRING HAS MORE THAN ONE MATCH. THE ARRAY INDEX WILL FAIL + # MODULE SAMPLE USE CASES: "NODE-RED-NODE-MYSQL, NODE-RED-NODE-MYSQL@2.0.0, NODE-RED-NODE-MYSQL/, @FLOWFUSE/NODE-RED-DASHBOARD, @FLOWFUSE/NODE-RED-DASHBOARD/, @FLOWFUSE/NODE-RED-DASHBOARD@1.2.3, + # OLD SPLIT MODULE_NAME, VERSION = MODULE.RSPLIT('/', 1)[-1].SPLIT('@', 1) IF '@' IN MODULE ELSE (MODULE, NONE) + # TRAILING SLASH - ONLY AT THE END + module = module[:-1] if module.endswith('/') else module + # SPLIT AT LAST @ EVEN IF NONE OR MORE THAN ONE + module_name, version = (module[:module.rfind('@')], module[module.rfind('@') + 1:]) if '@' in module else (module, None) except: module_name, version = module, None payload_node_module = ''