From 5dbe4f11c93432efb1653a336637c4d01dd0122a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Tue, 7 Apr 2020 11:31:02 +0300 Subject: [PATCH] MXS-2948: Don't update passwords with cluster sync Not updating the passwords prevents the cluster sync from breaking working configurations. --- maxctrl/lib/cluster.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/maxctrl/lib/cluster.js b/maxctrl/lib/cluster.js index 1b3b4cc33..aa8a19702 100644 --- a/maxctrl/lib/cluster.js +++ b/maxctrl/lib/cluster.js @@ -183,7 +183,10 @@ exports.builder = function(yargs) { 'command on that instance. Synchronization can be attempted again if a previous ' + 'attempt failed due to a network failure or some other ephemeral error. Any other ' + 'errors require manual synchronization of the MaxScale configuration files and a ' + - 'restart of the failed Maxscale.') + 'restart of the failed Maxscale.\n\n' + + 'Note: New objects created by `cluster sync` will have a placeholder value and ' + + 'must be manually updated. Passwords for existing objects will not be updated ' + + 'by `cluster sync` and must also be manually updated.') .usage('Usage: cluster sync ') }, function(argv) { maxctrl(argv, function(host) { @@ -270,6 +273,8 @@ exports.builder = function(yargs) { // user resource as it requires passwords to be entered _.difference(collections, ['users']).forEach(function(i) { src[i].data.forEach(function(j) { + // Never updates passwords + j = _.omit(j, ['attributes.parameters.password', 'attributes.parameters.monitorpw']) promises.push(doAsyncRequest(host, i + '/' + j.id, null, {method: 'PATCH', body: {data: j}})) }) })