Better document StateChangeConf.WaitForState

This commit is contained in:
Phil Frost 2015-04-28 12:31:56 -04:00
parent fc26f7a119
commit bd8ac4fe5e
1 changed files with 11 additions and 0 deletions

View File

@ -34,6 +34,17 @@ type StateChangeConf struct {
// WaitForState watches an object and waits for it to achieve the state
// specified in the configuration using the specified Refresh() func,
// waiting the number of seconds specified in the timeout configuration.
//
// If the Refresh function returns a error, exit immediately with that error.
//
// If the Refresh function returns a state other than the Target state or one
// listed in Pending, return immediately with an error.
//
// If the Timeout is exceeded before reaching the Target state, return an
// error.
//
// Otherwise, result the result of the first call to the Refresh function to
// reach the target state.
func (conf *StateChangeConf) WaitForState() (interface{}, error) {
log.Printf("[DEBUG] Waiting for state to become: %s", conf.Target)