~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
..
bootstrap 1603.8.3 10 years ago Ian Booth Factor out commom bootstrap logic Diff
cloudinit 377.6.3 11 years ago Dave Cheney wip Diff
config 300.1.1 11 years ago Gustavo Niemeyer Config 3000. Diff
imagemetadata 1157.4.9 11 years ago Ian Booth Initial code review tweaks Diff
instances 1157.2.13 11 years ago Ian Booth Move new common instance handling code to environs Diff
jujutest 19.1.1 12 years ago Roger Peppe added skeleton ec2 and jujutest packages Diff
localstorage 1345.1.1 10 years ago Roger Peppe environs/localstorage: rename from environs/local" Diff
simplestreams 1603.3.1 10 years ago Ian Booth Refactor simplestreams into generic and type speci Diff
sync 1487.3.1 10 years ago Frank Mueller sync: moved tool synchronization logic into own pa Diff
testing 1092.2.5 11 years ago Tim Penhey Use new version functions in tests and code. Diff
tools 1603.4.1 10 years ago Ian Booth Add support for parsing and validating tools metad Diff
boilerplate_config.go 1206.2.1 11 years ago Martin Packman Add copyright statement at the top of all go files 2.4 KB Diff Download File
boilerplate_config_test.go 1666.1.17 10 years ago Roger Peppe merge 373-ec2-no-s3-retry 678 bytes Diff Download File
broker.go 1603.8.6 10 years ago Ian Booth Rename Broker to InstanceBroker 1.1 KB Diff Download File
cert.go 1408.1.1 10 years ago John Arbash Meinel Start changing the imports of the middle level fil 2.3 KB Diff Download File
cert_internal_test.go 1666.1.9 10 years ago Roger Peppe merge 371-gocheck-cleanup-s-w 1.3 KB Diff Download File
cert_test.go 1666.1.10 10 years ago Roger Peppe environs: fix forgotten conflict 2.7 KB Diff Download File
cloudinit.go 1603.8.3 10 years ago Ian Booth Factor out commom bootstrap logic 4.6 KB Diff Download File
cloudinit_test.go 1603.7.4 10 years ago Ian Booth Pull out Tools struct to its own package 4.9 KB Diff Download File
config.go 1573.3.9 10 years ago Nate Finch last few changes from reviews 5.7 KB Diff Download File
config_test.go 1666.1.7 10 years ago Roger Peppe merge 367-environs-provider-move 6.1 KB Diff Download File
emptystorage.go 1544.2.3 10 years ago jtv at canonical Turns out we don't need Min: 1 on AttemptStrategy. 1.6 KB Diff Download File
emptystorage_test.go 1666.1.17 10 years ago Roger Peppe merge 373-ec2-no-s3-retry 2.1 KB Diff Download File
export_test.go 1718.5.2 10 years ago Roger Peppe it all compiles 184 bytes Diff Download File
interface.go 1666.1.23 10 years ago Roger Peppe merge 373-ec2-no-s3-retry 7.8 KB Diff Download File
mongo.go 1206.2.1 11 years ago Martin Packman Add copyright statement at the top of all go files 374 bytes Diff Download File
mongo_test.go 1666.1.17 10 years ago Roger Peppe merge 373-ec2-no-s3-retry 2 KB Diff Download File
open.go 1666.1.8 10 years ago Roger Peppe test changes for Prepare. some tests pass 3.4 KB Diff Download File
open_test.go 1666.1.24 10 years ago Roger Peppe gofmt 4.6 KB Diff Download File
storage.go 1414.2.2 10 years ago jtv at canonical Utility RemoveAll implementation. 747 bytes Diff Download File
suite_test.go 1408.1.1 10 years ago John Arbash Meinel Start changing the imports of the middle level fil 225 bytes Diff Download File