Created
August 3, 2017 21:31
-
-
Save btsimonh/c18883a873ad9805f82bfbaf5b3e0b1f to your computer and use it in GitHub Desktop.
for nick - patch illustrating fixing credentials in runtime/nodes/flows/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~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) { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.