-
Notifications
You must be signed in to change notification settings - Fork 77
added copykey job and tasks #168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
lib/jobs/copy-publickey.js
Outdated
| {cmd: 'mkdir -p .ssh'}, | ||
| {cmd: 'echo '+node.sshSettings.publicKey+' >> .ssh/authorized_keys'} | ||
| ]; | ||
| return Promise.map(commands, function(commandData) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The order of the commands matters, but the order that Promise.map calls the mapper function is not guaranteed. Promise.each or Promise.mapSeries guarantees order.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to know.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zyoung51 does it queue them off in order, but the resolution order isn't guaranteed in the result object? Or is order of execution also not guaranteed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here it is applicable as you want to wait for the command utility to resolve before issuing the next command utility call. Map will call the mapping function for each input item in whatever order they resolve and, unless you fiddle with concurrency, will not wait for the returned promise to resolve before calling the next iteration of the mapping function.
Mapseries and each will sequentially wait for the input promise to resolve and also wait for the mapping function's returned promise to resolve before iterating on the next item in the array.
|
So the diff will become smaller after #150 is merged? |
|
Yes the diff will shrink |
|
d22ff9e to
3a8cb61
Compare
|
👍 |
|
@RackHD/corecommitters |
3a8cb61 to
8ceb8d9
Compare
lib/jobs/copy-publickey.js
Outdated
| self._done(); | ||
| }) | ||
| .catch(function(err) { | ||
| logger.debug("Error copying public key", {error: err}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably be logger.error ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please
|
| ) { | ||
| var logger = Logger.initialize(copyKeyJobFactory); | ||
| var commandUtil; | ||
| function CopyKeyJob(options, context, taskId) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a little jsdoc noting that context.target should be a nodeID would be potentially useful here
|
👍 with the logger.debug => logger.error change |
8ceb8d9 to
3515b3a
Compare
|
|
test this please |
|
|
test this please |
|
|
test this please |
|
|
closing because the changes are being included in #171 |
changed decommission graph to use sgdisk
more support for in-band management: added a job/tasks for copying an ssh public key to a node. Also refactored the sshExec method from ssh-job into command-util.
should probably wait on #150 to merge
@benbp