-
Notifications
You must be signed in to change notification settings - Fork 302
fleetctl: status and restart commands with global units #1624
fleetctl: status and restart commands with global units #1624
Conversation
ba57a71
to
64f8b0e
Compare
54409ab
to
a1a21b8
Compare
150d30c
to
4002bf5
Compare
3b60e93
to
875d938
Compare
bdc94e8
to
fa5aa3a
Compare
@dongsupark have you been using this since you created this PR? How's it holding up? We've been doing something similar outside of fleet using SSH connections and calling Is anyone planning to review and merge this in the near future? |
@simonvanderveldt |
64f8b0e
to
fe560b0
Compare
20a3e96
to
3aaa1ab
Compare
d591ce2
to
de2fcc7
Compare
0e864e0
to
f77faa3
Compare
eb6872f
to
365565e
Compare
fleetctl status should handle machine states of global units, instead of failing with errors. To avoid creating individual ssh connection for each machine for global unit, global units need to be first inserted into a list of global units. They are filtered again to contain only unique pairs of (unit name, machine ID), before fleetctl finally initiates connection to each of the machines.
Fleetctl restart allows users to easily restart units on every machine, without having to run manually like "fleetctl ssh systemctl restart". Both global units and non-global units are supported. Originally written by Kyle Boorky <kboorky@turbine.com> See also coreos#1238
Now that the "fleetctl restart" command is available, a new unit test is also necessary correspondently.
For start command, we don't need to explicitly check for systemd active states, as fleetctl start is already doing that.
A new functional test TestUnitRestart is also needed to verify that the new command "fleetctl restart" works well.
Now that fleetctl status & restart is able to run with global units, TestScheduleGlobalUnits() needs to run "fleetctl status" as well as "fleetctl restart" also with a global unit, to verify that the new functionality is working too.
f77faa3
to
060abbf
Compare
Fixed minor things, and force-pushed. |
39a99ba
to
44591b0
Compare
…-units fleetctl: status and restart commands with global units
This PR is yet another revision of a long-running issue,
fleetctl restart
andstatus
with global units."fleetctl status"
to run with global units. For the purpose, implement a helpercmdGlobalMachineState()
that filters a list of machines only with unique entries."fleetctl restart"
. This part is originally taken from fleetctl: Adding restart command #1238 written by "Kyle Boorky kboorky@turbine.com", committed by @hhoover .fleetctl restart
.TestScheduleGlobalUnits()
.This PR is not about changing API or metadata format in etcd registry. It's not introducing any new mechanism, because I don't think I can afford changing such design at the moment. It's rather a compromise between practical requirements and the current design of fleet. Though we still need to think about how to decrease number of ssh connections when restarting global units, as suggested by @kayrus. See also #1559.
Fixes #975