Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/node-red/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
5 changes: 3 additions & 2 deletions charts/node-red/README.md.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
8 changes: 7 additions & 1 deletion charts/node-red/scripts/flow_refresh.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ''
Expand Down
Loading