~natefinch/juju-core/jameinel-1.18-panic-parsing-jenv-1312136

« back to all changes in this revision

Viewing changes to state/api/agent/state.go

[r=wallyworld],[bug=1303697] Backport trunk r2606
lp:~fwereade/juju-core/uniter-relation-states

worker/uniter: startup with correct relation state

The uniter's runListener is not started until after relation state is set
up; and relation state setup is fixed to use true relation state from the
API server rather than the local best guess, which is inaccurate when any
joined relation has never seen a remote unit.

This involves a new API, which the unit agent will wait for, in case it
connects to an API server which hasn't yet been upgraded.

https://codereview.appspot.com/85670046/

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
                return nil, err
33
33
        }
34
34
        if len(results.Entities) != 1 {
35
 
                return nil, fmt.Errorf("expected one result, got %d", len(results.Entities))
 
35
                return nil, fmt.Errorf("expected 1 result, got %d", len(results.Entities))
36
36
        }
37
37
        if err := results.Entities[0].Error; err != nil {
38
38
                return nil, err