MXS-2948: Don't update passwords with cluster sync

Not updating the passwords prevents the cluster sync from breaking working
configurations.
This commit is contained in:
Markus Mäkelä 2020-04-07 11:31:02 +03:00
parent 983b8247dd
commit 5dbe4f11c9
No known key found for this signature in database
GPG Key ID: 5CE746D557ACC499

View File

@ -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 <target>')
}, 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}}))
})
})