Merge lp://qastaging/~axwalk/juju-core/lp1247232-bootstrap-majorminorpatch into lp://qastaging/~go-bot/juju-core/trunk
Status: | Merged | ||||||||
---|---|---|---|---|---|---|---|---|---|
Approved by: | Andrew Wilkins | ||||||||
Approved revision: | no longer in the source branch. | ||||||||
Merged at revision: | 2644 | ||||||||
Proposed branch: | lp://qastaging/~axwalk/juju-core/lp1247232-bootstrap-majorminorpatch | ||||||||
Merge into: | lp://qastaging/~go-bot/juju-core/trunk | ||||||||
Diff against target: |
148 lines (+97/-2) 3 files modified
environs/bootstrap/bootstrap.go (+38/-1) environs/bootstrap/bootstrap_test.go (+59/-0) tools/list.go (+0/-1) |
||||||||
To merge this branch: | bzr merge lp://qastaging/~axwalk/juju-core/lp1247232-bootstrap-majorminorpatch | ||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju Engineering | Pending | ||
Review via email: mp+216278@code.qastaging.launchpad.net |
Commit message
environs/bootstrap: bootstrap major.minor.patch
Bootstrap tools selection is changed so that it
will select tools with the same major, minor and
patch level as the current (CLI) tools if possible.
If there are no such tools, the most recent tools
with matching major/minor are chosen as before and
a warning will be logged.
This change allows us to change bootstrap behaviour
even within a minor release series (except of course
for existing releases).
The most recent tools with matching major/minor will
be set in agent-version, which causes the machine
agent to immediately upgrade.
Fixes lp:1247232
Description of the change
environs/bootstrap: bootstrap major.minor.patch
Bootstrap tools selection is changed so that it
will select tools with the same major, minor and
patch level as the current (CLI) tools if possible.
If there are no such tools, the most recent tools
with matching major/minor are chosen as before and
a warning will be logged.
This change allows us to change bootstrap behaviour
even within a minor release series (except of course
for existing releases).
The most recent tools with matching major/minor will
be set in agent-version, which causes the machine
agent to immediately upgrade.
Fixes lp:1247232
Reviewers: mp+216278_ code.launchpad. net,
Message:
Please take a look.
Description:
environs/bootstrap: bootstrap major.minor.patch
Bootstrap tools selection is changed so that it
will select tools with the same major, minor and
patch level as the current (CLI) tools if possible.
If there are no such tools, the most recent tools
with matching major/minor are chosen as before and
a warning will be logged.
This change allows us to change bootstrap behaviour
even within a minor release series (except of course
for existing releases).
The most recent tools with matching major/minor will
be set in agent-version, which causes the machine
agent to immediately upgrade.
Fixes lp:1247232
https:/ /code.launchpad .net/~axwalk/ juju-core/ lp1247232- bootstrap- majorminorpatch /+merge/ 216278
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/88840043/
Affected files (+85, -2 lines): bootstrap/ bootstrap. go bootstrap/ bootstrap_ test.go
A [revision details]
M environs/
M environs/
M tools/list.go
Index: [revision details] 20140417053051- il9peyrj37nd277 q
=== added file '[revision details]'
--- [revision details] 2012-01-01 00:00:00 +0000
+++ [revision details] 2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision: tarmac-
+New revision: <email address hidden>
Index: tools/list.go Errorf( "cannot match %#v", f)
=== modified file 'tools/list.go'
--- tools/list.go 2014-02-16 23:35:10 +0000
+++ tools/list.go 2014-04-17 09:19:41 +0000
@@ -130,7 +130,6 @@
}
}
if len(result) == 0 {
- logger.
return nil, ErrNoMatches
}
return result, nil
Index: environs/ bootstrap/ bootstrap. go bootstrap/ bootstrap. go' bootstrap/ bootstrap. go 2014-03-28 13:27:45 +0000 bootstrap/ bootstrap. go 2014-04-17 09:19:41 +0000 Newest( ) Infof(" picked newest version: %s", newVersion) Infof(" newest version: %s", newVersion) map[string] interface{ }{ oringBuild( newVersion, version. Current. Number) { ringBuild( tools.Version. Number, Current. Number) { Current. Number, newVersion,
=== modified file 'environs/
--- environs/
+++ environs/
@@ -56,7 +56,7 @@
}
var newVersion version.Number
newVersion, toolsList := possibleTools.
- logger.
+ logger.
cfg := environ.Config()
if agentVersion, _ := cfg.AgentVersion(); agentVersion != newVersion {
cfg, err := cfg.Apply(
@@ -69,9 +69,39 @@
return nil, fmt.Errorf("failed to update environment
configuration: %v", err)
}
}
+ // We should only ever bootstrap the exact same version as the client,
+ // or we risk bootstrap incompatibility. We still set agent-version to
+ // the newest version, so the agent will immediately upgrade itself.
+ //
+ // Build number is not important to match; uploaded tools will have
+ // incremented build number, and we want to match them.
+ bootstrapVersion := newVersion
+ if !sameVersionIgn
+ var sameTools coretools.List
+ for _, tools := range possibleTools {
+ if sameVersionIgno
version.
+ sameTools = append(sameTools, tools)
+ }
+ }
+ if len(sameTools) == 0 {
+ logger.Warningf(
+ "failed to find %s tools, will attempt to use %s",
+ version.
+ )
+ } else {
+ bootstrapVersion...