Skip to content

Instantly share code, notes, and snippets.

@btsimonh
Created August 3, 2017 21:31
Show Gist options
  • Save btsimonh/c18883a873ad9805f82bfbaf5b3e0b1f to your computer and use it in GitHub Desktop.
Save btsimonh/c18883a873ad9805f82bfbaf5b3e0b1f to your computer and use it in GitHub Desktop.
for nick - patch illustrating fixing credentials in runtime/nodes/flows/index.js
~line 112:
config = clone(_config);
newFlowConfig = flowUtil.parseConfig(clone(config));
diff = flowUtil.diffConfigs(activeFlowConfig,newFlowConfig);
console.log(util.inspect(diff));
// remove credentials before this becomes activeFlowConfig
for (var id in newFlowConfig.allNodes) {
if (newFlowConfig.allNodes.hasOwnProperty(id)) {
delete newFlowConfig.allNodes[id].credentials;
}
}
// this reads from a copy
credentials.clean(config);
var credsDirty = credentials.dirty();
configSavePromise = credentials.export().then(function(creds) {
@btsimonh
Copy link
Author

btsimonh commented Aug 3, 2017

credentials are left in newFlowConfig, which then becomes activeFlowConfig.
This stuffs up the diff, making the node which had credentials now 'different', and it and all it's peers end up in the changed list, which means they all get stopped and restarted unnecessarily.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment