Skip to content

Commit

Permalink
make nodes with only group change not deployed by nodes deploy mode
Browse files Browse the repository at this point in the history
  • Loading branch information
HiroyasuNishiyama committed Feb 12, 2021
1 parent f5da2eb commit 1be337f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/node_modules/@node-red/runtime/lib/flows/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@ function setFlows(_config,_credentials,type,muteLog,forceStart,user) {
// Parse the configuration
newFlowConfig = flowUtil.parseConfig(clone(config));
// Generate a diff to identify what has changed
diff = flowUtil.diffConfigs(activeFlowConfig,newFlowConfig);
diff = flowUtil.diffConfigs(activeFlowConfig,newFlowConfig,
(type === "nodes"));

// Now the flows have been compared, remove any credentials from newFlowConfig
// so they don't cause false-positive diffs the next time a flow is deployed
Expand Down
5 changes: 4 additions & 1 deletion packages/node_modules/@node-red/runtime/lib/flows/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ module.exports = {

parseConfig: parseConfig,

diffConfigs: function(oldConfig, newConfig) {
diffConfigs: function(oldConfig, newConfig, ignoreGroup) {
var id;
var node;
var nn;
Expand Down Expand Up @@ -438,6 +438,9 @@ module.exports = {
if (newConfig.allNodes.hasOwnProperty(id)) {
node = newConfig.allNodes[id];
for (var prop in node) {
if (ignoreGroup && (prop === "g")) {
continue;
}
if (node.hasOwnProperty(prop) && prop != "z" && prop != "id" && prop != "wires") {
// This node has a property that references a changed/removed node
// Assume it is a config node change and mark this node as
Expand Down

0 comments on commit 1be337f

Please sign in to comment.