-
Notifications
You must be signed in to change notification settings - Fork 302
api: support cAPI.UnitState() for a single unit #1679
api: support cAPI.UnitState() for a single unit #1679
Commits on Nov 7, 2016
-
api: support GET method for stateResource
HTTP client should be able to retrieve a unit state via URL like http://*/state/unitName. Support GET for stateResource just like unitResource.
Dongsu Park committedNov 7, 2016 Configuration menu - View commit details
-
Copy full SHA for 76c43f9 - Browse repository at this point
Copy the full SHA 76c43f9View commit details -
schema: introduce Get method for UnitState
Define Get method for UnitState in the schema, and regenerate both json and go.
Dongsu Park committedNov 7, 2016 Configuration menu - View commit details
-
Copy full SHA for 826f9c5 - Browse repository at this point
Copy the full SHA 826f9c5View commit details -
client: introduce UnitState() for API interface
Introduce UnitState() for API interface as well as HTTPClient struct.
Dongsu Park committedNov 7, 2016 Configuration menu - View commit details
-
Copy full SHA for ead9372 - Browse repository at this point
Copy the full SHA ead9372View commit details -
protobuf: define GetUnitState() for registryClient
Protobuf must also its own method GetUnitState().
Dongsu Park committedNov 7, 2016 Configuration menu - View commit details
-
Copy full SHA for 7afdc1d - Browse repository at this point
Copy the full SHA 7afdc1dView commit details -
registry: introduce UnitState() for etcdRegistry and RPCRegistry
UnitState() needs to be defined for etcdRegistry, RPCRegistry, and *RegistryMux*. Also inmemoryRegistry() needs to have UnitState().
Dongsu Park committedNov 7, 2016 Configuration menu - View commit details
-
Copy full SHA for 43e23ef - Browse repository at this point
Copy the full SHA 43e23efView commit details -
fleetctl: replace cAPI.UnitStates() with .UnitState()
Now fleetctl should be able to retrieve a unit state, using cAPI.UnitState(). Also get rid of getSingleUnitState() to simplify the logic.
Dongsu Park committedNov 7, 2016 Configuration menu - View commit details
-
Copy full SHA for 2133db7 - Browse repository at this point
Copy the full SHA 2133db7View commit details -
registry: add new unit tests for GetUnitState() and relevant ones
We should add new unit tests like TestUnitState() as well as TestInMemoryUnitState(), to cover the new cases like EtcdRegistry.UnitState() or inmemoryRegistry.UnitState().
Dongsu Park committedNov 7, 2016 Configuration menu - View commit details
-
Copy full SHA for 8aa001f - Browse repository at this point
Copy the full SHA 8aa001fView commit details
Commits on Nov 9, 2016
-
fleetctl: periodically check for systemd states using waitForState
Although checkSystemdActiveState() doesn't have to depend on cAPI.UnitStates(), it's still impossible to remove additional sleep in case of error from assertSystemdActiveState(). That's actually a known issue. Sometimes it simply takes much time until fleetctl became able to get valid unit states. Adding additional sleeps or tuning the sleep time wouldn't be a good approach, as an optimal sleep interval could vary a lot case by case. To gracefully handle this case, let's do similar checking as done in functional tests. * Introduce a new helper waitForState(), just like util.WaitForState() from functional tests. * Squash assertFetchSystemdActiveState() into assertSystemdActiveState() to make it retry the assertion periodically up to defaultSleepTime. * Increase defaultSleepTime from 500 to 2000 msec. * Remove the additional sleep call as well as cAPI.UnitState() call.
Dongsu Park committedNov 9, 2016 Configuration menu - View commit details
-
Copy full SHA for 57443ca - Browse repository at this point
Copy the full SHA 57443caView commit details -
fleetctl: make use of waitForState also in assertUnitState()
waitForUnitState() has been making use of an additional sleep, in case assertUnitState() returned error. Now that a helper waitForState() is available for fleetctl, we don't need to sleep there. So remove the sleep calls, and instead make assertUnitState() a wrapper of waitForState() over fetchUnitState(). That way, assertUnitState() can periodically retry to get a unit, up to defaultSleepTime. This is also good for consistency in the entire code, as assertSystemdActiveState() already depends on waitForState().
Dongsu Park committedNov 9, 2016 Configuration menu - View commit details
-
Copy full SHA for 9137746 - Browse repository at this point
Copy the full SHA 9137746View commit details