~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
..
agent 1409.2.2 10 years ago John Arbash Meinel Turn environs/agent into a top level agent/ packag Diff
bzr 1104.1.1 11 years ago Gustavo Niemeyer bzr: add package to handle Bazaar branches Diff
cert 734.5.14 11 years ago Roger Peppe add cert package Diff
charm 11 12 years ago Gustavo Niemeyer Applied the juju/charm renaming to the Go code bas Diff
cloudinit 25.2.1 12 years ago Roger Peppe add cloudinit package Diff
cmd 37.3.14 12 years ago William Reade hefty rearrangement, few actual changes Diff
constraints 1010.3.1 11 years ago Benji York checkpoint: tests pass; major refactoring to avoid Diff
container 1263.2.25 10 years ago Tim Penhey Merge prev pipe. Diff
doc 773.7.1 11 years ago William Reade added some draft documentation Diff
downloader 358.2.4 11 years ago Roger Peppe downloader: first test passes Diff
environs 25.5.4 12 years ago Roger Peppe rename environ->environs Diff
errors 1242.1.1 10 years ago Ian Booth Move common errors to erros package and remove dup Diff
instance 1274.1.3 10 years ago Tim Penhey Move environs.Instance into its own package. Diff
juju 37.3.14 12 years ago William Reade hefty rearrangement, few actual changes Diff
log 20.1.1 12 years ago Mathieu Lonjaret logger: use global vars, becomes a package Diff
names 1548.3.1 10 years ago Dimiter Naydenov names: new package Diff
provider 1657.3.1 10 years ago Roger Peppe move environs/provider to provider Diff
rpc 766.2.1 11 years ago Roger Peppe rpc: initial commit Diff
schema 1 12 years ago Gustavo Niemeyer Bootstrapped package. Diff
scripts 980.1.1 11 years ago Dave Cheney renamed contrib to scripts Diff
state 525.1.1 11 years ago Roger Peppe mstate: rename to state Diff
store 882.1.5 11 years ago John Arbash Meinel Merge trunk resolve series parameter conflict. Diff
testing 83.1.2 12 years ago William Reade renamed testutils; broke it in anticipation of goz Diff
thirdparty 623.3.1 11 years ago Roger Peppe environs: add PasswordHash and RandomBytes Diff
tools 1603.7.4 10 years ago Ian Booth Pull out Tools struct to its own package Diff
upstart 152.5.1 11 years ago William Reade first cut, untested Diff
utils 1151.1.1 11 years ago Tim Penhey Trivial rename of trivial -> utils. Diff
version 124.2.2 12 years ago Roger Peppe version: simplify Diff
worker 295.1.1 11 years ago Dave Cheney service => worker Diff
.bzrignore 1581.3.11 10 years ago Gavin Panella Editor artifacts to ignore should still be in ~/.b 148 bytes Diff Download File
.lbox 269.4.7 11 years ago William Reade whoops: readd .lbox 30 bytes Diff Download File
File .lbox.check 1278.2.2 10 years ago Danilo Šegan Move emacs auto-save files check to find command i 590 bytes Diff Download File
CONTRIBUTING 1590.2.4 10 years ago Roger Peppe include dependency info in CONTRIBUTING 8.1 KB Diff Download File
dependencies.tsv 1714.1.1 10 years ago Andrew Wilkins Update gwacl in dependencies.tsv Critical bug fix 1 KB Diff Download File
LICENCE 703.1.1 11 years ago Dave Cheney + LICENCE 33.7 KB Diff Download File
Makefile 1581.3.17 10 years ago Gavin Panella At the suggestion of Roger Peppe, don't treat form 1.6 KB Diff Download File
README 1614.2.4 10 years ago Michael Nelson Stable PPA for mongodb-server and better comment a 4.3 KB Diff Download File