~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
..
builddb 580.4.2 11 years ago Gustavo Niemeyer Moved builddb to cmd/. Now that environs packs to Diff
charmd 882.1.5 11 years ago John Arbash Meinel Merge trunk resolve series parameter conflict. Diff
charmload 882.1.5 11 years ago John Arbash Meinel Merge trunk resolve series parameter conflict. Diff
juju 37.3.14 12 years ago William Reade hefty rearrangement, few actual changes Diff
jujud 50.1.2 12 years ago William Reade untested sketch of jujud command Diff
plugins 1483.2.11 10 years ago Ian Booth Make the simplestreams metadata commands plugins Diff
cmd.go 1662 10 years ago Tarmac [r=natefinch] return error on no environment Now, 5.4 KB Diff Download File
cmd_test.go 1657.1.6 10 years ago Roger Peppe gocheck imports - a-d 3.8 KB Diff Download File
environmentcommand.go 1573.3.12 10 years ago Nate Finch merge from trunk 2.1 KB Diff Download File
environmentcommand_test.go 1657.1.6 10 years ago Roger Peppe gocheck imports - a-d 2.2 KB Diff Download File
export_test.go 1483.2.11 10 years ago Ian Booth Make the simplestreams metadata commands plugins 268 bytes Diff Download File
filevar.go 1206.2.1 11 years ago Martin Packman Add copyright statement at the top of all go files 667 bytes Diff Download File
filevar_test.go 1657.1.6 10 years ago Roger Peppe gocheck imports - a-d 1.4 KB Diff Download File
logging.go 1245.8.11 10 years ago Martin Packman Merge trunk to resolve conflicts with machiner to 1.5 KB Diff Download File
logging_test.go 1657.1.6 10 years ago Roger Peppe gocheck imports - a-d 2.4 KB Diff Download File
names.go 1581.1.2 10 years ago Ian Booth Code review tweaks 602 bytes Diff Download File
names_test.go 1581.1.2 10 years ago Ian Booth Code review tweaks 1 KB Diff Download File
output.go 1408.1.1 10 years ago John Arbash Meinel Start changing the imports of the middle level fil 4.4 KB Diff Download File
output_test.go 1657.1.6 10 years ago Roger Peppe gocheck imports - a-d 3.4 KB Diff Download File
supercommand.go 1658 10 years ago Tarmac [r=dimitern],[bug=1183159] Extra options for ssh/s 12.4 KB Diff Download File
supercommand_test.go 1657.1.6 10 years ago Roger Peppe gocheck imports - a-d 8.6 KB Diff Download File
util_test.go 1408.1.1 10 years ago John Arbash Meinel Start changing the imports of the middle level fil 1.5 KB Diff Download File
version.go 1408.1.1 10 years ago John Arbash Meinel Start changing the imports of the middle level fil 646 bytes Diff Download File
version_test.go 1657.1.6 10 years ago Roger Peppe gocheck imports - a-d 1.2 KB Diff Download File