~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
..
addmachine.go 1573.3.12 10 years ago Nate Finch merge from trunk 2.9 KB Diff Download File
addmachine_test.go 1657.1.6 10 years ago Roger Peppe gocheck imports - a-d 3.3 KB Diff Download File
addrelation.go 1573.3.12 10 years ago Nate Finch merge from trunk 1 KB Diff Download File
addrelation_test.go 1657.1.6 10 years ago Roger Peppe gocheck imports - a-d 3.8 KB Diff Download File
addunit.go 1712.1.1 10 years ago John Arbash Meinel Switch from NewAPIConnFromName to NewAPIClientFrom 2.5 KB Diff Download File
addunit_test.go 1657.1.6 10 years ago Roger Peppe gocheck imports - a-d 4.1 KB Diff Download File
bootstrap.go 1666.1.23 10 years ago Roger Peppe merge 373-ec2-no-s3-retry 4.8 KB Diff Download File
bootstrap_test.go 1666.1.23 10 years ago Roger Peppe merge 373-ec2-no-s3-retry 9.9 KB Diff Download File
cmd_test.go 1666.1.19 10 years ago Roger Peppe gofmt 12.5 KB Diff Download File
constraints.go 1573.3.12 10 years ago Nate Finch merge from trunk 3 KB Diff Download File
constraints_test.go 1657.1.6 10 years ago Roger Peppe gocheck imports - a-d 4.5 KB Diff Download File
debughooks.go 1537.5.7 10 years ago Andrew Wilkins debug-hooks: code cleanup (review comments) 2.4 KB Diff Download File
debughooks_test.go 1657.1.6 10 years ago Roger Peppe gocheck imports - a-d 7.1 KB Diff Download File
debuglog.go 1658 10 years ago Tarmac [r=dimitern],[bug=1183159] Extra options for ssh/s 2.3 KB Diff Download File
debuglog_test.go 1578.2.4 10 years ago Andrew Wilkins Add -n/--lines to juju debug-log Same format as e 2.2 KB Diff Download File
deploy.go 1573.3.12 10 years ago Nate Finch merge from trunk 4.3 KB Diff Download File
deploy_test.go 1682.6.3 10 years ago Frank Mueller cmd/juju: changed unset and get/set/unset testing 8.2 KB Diff Download File
destroyenvironment.go 1573.3.12 10 years ago Nate Finch merge from trunk 1.4 KB Diff Download File
destroymachine.go 1573.3.12 10 years ago Nate Finch merge from trunk 1.1 KB Diff Download File
destroymachine_test.go 1657.1.6 10 years ago Roger Peppe gocheck imports - a-d 2.6 KB Diff Download File
destroyrelation.go 1573.3.12 10 years ago Nate Finch merge from trunk 1.1 KB Diff Download File
destroyrelation_test.go 1657.1.6 10 years ago Roger Peppe gocheck imports - a-d 1.3 KB Diff Download File
destroyservice.go 1573.3.12 10 years ago Nate Finch merge from trunk 1.2 KB Diff Download File
destroyservice_test.go 1657.1.6 10 years ago Roger Peppe gocheck imports - a-d 1.4 KB Diff Download File
destroyunit.go 1573.3.12 10 years ago Nate Finch merge from trunk 1.3 KB Diff Download File
destroyunit_test.go 1657.1.6 10 years ago Roger Peppe gocheck imports - a-d 1.1 KB Diff Download File
endpoint.go 1611.2.5 10 years ago Kapil Thangavelu add long form doc for endpoint 1.2 KB Diff Download File
endpoint_test.go 1611.2.3 10 years ago Kapil Thangavelu address review comments, rename to api-endpoints, 748 bytes Diff Download File
environment.go 1573.3.12 10 years ago Nate Finch merge from trunk 3.9 KB Diff Download File
environment_test.go 1657.1.6 10 years ago Roger Peppe gocheck imports - a-d 4.3 KB Diff Download File
expose.go 1573.3.12 10 years ago Nate Finch merge from trunk 1 KB Diff Download File
expose_test.go 1657.1.6 10 years ago Roger Peppe gocheck imports - a-d 1.1 KB Diff Download File
get.go 1712.2.1 10 years ago John Arbash Meinel Implement 'juju get' via the API. The actual CLI 1.4 KB Diff Download File
get_test.go 1682.6.3 10 years ago Frank Mueller cmd/juju: changed unset and get/set/unset testing 2.4 KB Diff Download File
help_topics.go 1636.1.6 10 years ago Tim Penhey Update the header block. 13 KB Diff Download File
helptool.go 1528.3.2 10 years ago Andrew Wilkins Move help-tool command to cmd/juju And add some t 2.4 KB Diff Download File
helptool_test.go 1657.1.6 10 years ago Roger Peppe gocheck imports - a-d 1.3 KB Diff Download File
init.go 1573.3.12 10 years ago Nate Finch merge from trunk 1.8 KB Diff Download File
init_test.go 1573.3.12 10 years ago Nate Finch merge from trunk 3.2 KB Diff Download File
main.go 1666.1.7 10 years ago Roger Peppe merge 367-environs-provider-move 4.7 KB Diff Download File
main_test.go 1666.1.17 10 years ago Roger Peppe merge 373-ec2-no-s3-retry 9.1 KB Diff Download File
plugin.go 1581.2.1 10 years ago Ian Booth Remove arg parsing from plugin callout and add tes 4 KB Diff Download File
plugin_test.go 1657.1.6 10 years ago Roger Peppe gocheck imports - a-d 6.8 KB Diff Download File
publish.go 1573.3.12 10 years ago Nate Finch merge from trunk 4.8 KB Diff Download File
publish_test.go 1657.1.6 10 years ago Roger Peppe gocheck imports - a-d 13.3 KB Diff Download File
resolved.go 1573.3.12 10 years ago Nate Finch merge from trunk 1.2 KB Diff Download File
resolved_test.go 1657.1.6 10 years ago Roger Peppe gocheck imports - a-d 2.4 KB Diff Download File
scp.go 1573.3.12 10 years ago Nate Finch merge from trunk 1.5 KB Diff Download File
scp_test.go 1657.1.6 10 years ago Roger Peppe gocheck imports - a-d 1.7 KB Diff Download File
set.go 1682.6.1 10 years ago Frank Mueller cmd/juju: aded new unset command 2.6 KB Diff Download File
set_test.go 1682.6.3 10 years ago Frank Mueller cmd/juju: changed unset and get/set/unset testing 2.8 KB Diff Download File
ssh.go 1662 10 years ago Tarmac [r=natefinch] return error on no environment Now, 3.5 KB Diff Download File
ssh_test.go 1657.1.6 10 years ago Roger Peppe gocheck imports - a-d 3.8 KB Diff Download File
status.go 1603.7.4 10 years ago Ian Booth Pull out Tools struct to its own package 19.2 KB Diff Download File
status_test.go 1603.7.6 10 years ago Ian Booth Fix tests 39.4 KB Diff Download File
switch.go 1483.2.11 10 years ago Ian Booth Make the simplestreams metadata commands plugins 3.1 KB Diff Download File
switch_test.go 1657.1.6 10 years ago Roger Peppe gocheck imports - a-d 4.5 KB Diff Download File
synctools.go 1666.1.19 10 years ago Roger Peppe gofmt 2.4 KB Diff Download File
synctools_test.go 1666.1.22 10 years ago Roger Peppe minor changes for review 3.3 KB Diff Download File
unexpose.go 1573.3.12 10 years ago Nate Finch merge from trunk 1.1 KB Diff Download File
unexpose_test.go 1657.1.6 10 years ago Roger Peppe gocheck imports - a-d 1.3 KB Diff Download File
unset.go 1682.6.3 10 years ago Frank Mueller cmd/juju: changed unset and get/set/unset testing 1.5 KB Diff Download File
unset_test.go 1682.6.5 10 years ago Frank Mueller cmd/juju: changed test after review and merged tru 2.7 KB Diff Download File
upgradecharm.go 1573.3.12 10 years ago Nate Finch merge from trunk 5.3 KB Diff Download File
upgradecharm_test.go 1657.1.6 10 years ago Roger Peppe gocheck imports - a-d 6.9 KB Diff Download File
upgradejuju.go 1603.7.8 10 years ago Ian Booth Alias all conflicting tools imports 9.6 KB Diff Download File
upgradejuju_test.go 1603.7.8 10 years ago Ian Booth Alias all conflicting tools imports 14.1 KB Diff Download File