~arosales/juju-core/update-azure-boilerplate

[r=jameinel],[bug=1218256] upgrader: add Upgrader.DesiredVersion

The initial implementation of the API version of the Upgrader had a
single API endpoint Tools() that it used to find both the desired agent
version to run, and the URL to download tools matching that version.
This was simple, but caused bug #1218256. Specifically, it means that
the API Server needs to have provider (eg ec2) credentials in order to
answer the Tools request. (So it can search the storage and see what the
URL for downloading the tools is.)

As such after bootstrap (before the first connect), the Upgrader would
keep bouncing as it got an error trying to determine what agent version
it should run as.

This adds one more api: Upgrader.DesiredVersion(). This only returns the
agent version string. Which can be served directly from the DB after
bootstrap, without having to look at the provider at all.

And even beyond the first bootstrap, the current implementation of
WatchAPIVersion is very naive and will trigger a probe on any change to
EnvironConfig. At present that means it also triggers a listing of all
Storage buckets to find the tools that will match for that agent. With
the new implementation, it only provokes a DesiredVersion() call which
is relatively small and doesn't talk to a 3rd party data source.

This isn't strictly backwards compatible. If we upgrade a machine-1
agent before upgrading the machine-0 agent, machine-1 will keep bouncing
until machine-0 has finished upgrading and has the new API available.
That was already true of upgrading from 1.12 to 1.13.x, so we haven't
made the upgrade-to-1.14 story any worse. (Agents will still notice they
have to upgrade, and start trying to upgrade, they will just keep
bouncing after the upgrade until machine-0 finishes its upgrade.)

We *could* do something where if DesiredVersion can't be called, we fall
back to Tools and if that fails we fall back to direct DB access. But I
don't think it is worth spending the time on that code path right now.

https://codereview.appspot.com/13380043/
Filename Latest Rev Last Changed Committer Comment Size
..
api 767.1.1 11 years ago Roger Peppe api: initial commit Diff
apiserver 956.3.2 11 years ago Roger Peppe state/apiserver: continue factoring out Diff
multiwatcher 1113.2.4 11 years ago Roger Peppe multiwatcher: renaming a'plenty Diff
presence 456.1.1 11 years ago Gustavo Niemeyer Importing new presence implementation. Diff
statecmd 904.2.1 11 years ago Roger Peppe statecmd: new package; wip Diff
testing 1340.3.1 10 years ago Martin Packman Make helpers in state/watcher_test.go shared by re Diff
watcher 475.2.1 11 years ago Gustavo Niemeyer mstate/watcher: new foundation for watchers Diff
address.go 1573.1.3 10 years ago Martin Packman Export fields from state.address so mongo can seri 942 bytes Diff Download File
address_test.go 1489.1.2 10 years ago Martin Packman Address review comments from dimitern and thumper 834 bytes Diff Download File
annotator.go 1560.1.1 10 years ago William Reade unexport ParseTag 4.5 KB Diff Download File
annotator_test.go 1657.2.1 10 years ago Roger Peppe gocheck imports - s-w 2.9 KB Diff Download File
assign_test.go 1657.2.1 10 years ago Roger Peppe gocheck imports - s-w 38 KB Diff Download File
bench_test.go 1657.2.1 10 years ago Roger Peppe gocheck imports - s-w 1.1 KB Diff Download File
charm.go 1408.1.1 10 years ago John Arbash Meinel Start changing the imports of the middle level fil 1.4 KB Diff Download File
charm_test.go 1657.2.1 10 years ago Roger Peppe gocheck imports - s-w 3.9 KB Diff Download File
conn_test.go 1657.2.1 10 years ago Roger Peppe gocheck imports - s-w 2.5 KB Diff Download File
constraints.go 1651.3.12 10 years ago Sidnei da Silva - Rename os-disk to root-disk all around on mgz's 2 KB Diff Download File
container.go 1548.1.1 10 years ago Martin Packman Fix some it's->its in state/container.go comments 3.9 KB Diff Download File
endpoint.go 1659.1.2 10 years ago Dimiter Naydenov Missed that change 1.7 KB Diff Download File
endpoint_test.go 1657.2.1 10 years ago Roger Peppe gocheck imports - s-w 1.8 KB Diff Download File
environ.go 1548.3.1 10 years ago Dimiter Naydenov names: new package 1.9 KB Diff Download File
environ_test.go 1657.2.1 10 years ago Roger Peppe gocheck imports - s-w 1.1 KB Diff Download File
export_test.go 1657.2.1 10 years ago Roger Peppe gocheck imports - s-w 6 KB Diff Download File
initialize_test.go 1657.2.1 10 years ago Roger Peppe gocheck imports - s-w 4.2 KB Diff Download File
interface.go 1603.7.4 10 years ago Ian Booth Pull out Tools struct to its own package 2.9 KB Diff Download File
life.go 1408.1.1 10 years ago John Arbash Meinel Start changing the imports of the middle level fil 1 KB Diff Download File
life_test.go 1657.2.1 10 years ago Roger Peppe gocheck imports - s-w 4.4 KB Diff Download File
machine.go 1603.7.4 10 years ago Ian Booth Pull out Tools struct to its own package 21.2 KB Diff Download File
machine_test.go 1603.7.8 10 years ago Ian Booth Alias all conflicting tools imports 30 KB Diff Download File
megawatcher.go 1588.1.8 10 years ago Roger Peppe merge lp:juju-core/trunk 14.5 KB Diff Download File
megawatcher_internal_test.go 1657.2.1 10 years ago Roger Peppe gocheck imports - s-w 28.6 KB Diff Download File
minimumunits.go 1585.2.1 10 years ago Roger Peppe all: remove unnecessary panic("unreachable") 6 KB Diff Download File
minimumunits_test.go 1657.2.1 10 years ago Roger Peppe gocheck imports - s-w 11.6 KB Diff Download File
open.go 1667.3.22 10 years ago Tim Penhey Better logging. 8.8 KB Diff Download File
relation.go 1665.1.3 10 years ago Dimiter Naydenov Changes after review 8.4 KB Diff Download File
relation_internal_test.go 1657.2.1 10 years ago Roger Peppe gocheck imports - s-w 935 bytes Diff Download File
relation_test.go 1657.2.1 10 years ago Roger Peppe gocheck imports - s-w 10.9 KB Diff Download File
relationunit.go 1687.1.1 10 years ago Dimiter Naydenov RU.InScope() now returns an error as well 13 KB Diff Download File
relationunit_test.go 1687.1.1 10 years ago Dimiter Naydenov RU.InScope() now returns an error as well 22.8 KB Diff Download File
sequence.go 1408.1.1 10 years ago John Arbash Meinel Start changing the imports of the middle level fil 633 bytes Diff Download File
service.go 1548.3.3 10 years ago Dimiter Naydenov Changes after review 26.1 KB Diff Download File
service_test.go 1723.1.1 10 years ago Frank Mueller charm: reverted branch 39.5 KB Diff Download File
settings.go 1568.2.4 10 years ago Sidnei da Silva - Go fmt 8.9 KB Diff Download File
settings_test.go 1657.2.1 10 years ago Roger Peppe gocheck imports - s-w 14.7 KB Diff Download File
state.go 1690.3.2 10 years ago Andrew Wilkins Merge with trunk 35.5 KB Diff Download File
state_test.go 1690.3.2 10 years ago Andrew Wilkins Merge with trunk 52.5 KB Diff Download File
status.go 1560.2.3 10 years ago William Reade address review 2.4 KB Diff Download File
tools_test.go 1603.7.5 10 years ago Ian Booth Fix tests 1.9 KB Diff Download File
unit.go 1603.7.4 10 years ago Ian Booth Pull out Tools struct to its own package 38.4 KB Diff Download File
unit_test.go 1682.4.4 10 years ago Roger Peppe state: remove unnecessary sleeps; use presence.Syn 34.6 KB Diff Download File
user.go 1408.1.1 10 years ago John Arbash Meinel Start changing the imports of the middle level fil 2.8 KB Diff Download File
user_test.go 1657.2.1 10 years ago Roger Peppe gocheck imports - s-w 1.6 KB Diff Download File
watcher.go 1682.4.5 10 years ago Roger Peppe state: remove redundant comment 33.7 KB Diff Download File