Merge lp:~axwalk/juju-core/azure-mode-nounitplacement into lp:~go-bot/juju-core/trunk
Status: | Merged |
---|---|
Approved by: | Andrew Wilkins |
Approved revision: | no longer in the source branch. |
Merged at revision: | 2555 |
Proposed branch: | lp:~axwalk/juju-core/azure-mode-nounitplacement |
Merge into: | lp:~go-bot/juju-core/trunk |
Prerequisite: | lp:~axwalk/juju-core/state-environcapability |
Diff against target: |
301 lines (+154/-12) 5 files modified
provider/azure/config.go (+16/-0) provider/azure/config_test.go (+33/-0) provider/azure/environ.go (+19/-11) provider/azure/environ_test.go (+77/-0) provider/azure/environprovider.go (+9/-1) |
To merge this branch: | bzr merge lp:~axwalk/juju-core/azure-mode-nounitplacement |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju Engineering | Pending | ||
Review via email: mp+211863@code.launchpad.net |
Commit message
provider/azure: availability-
A new config attribute availability-
is defined, which controls the mode in which the
Azure environment operates. If true (the default),
availability set support is enabled and instances
will be grouped by service. The attribute cannot
be changed after the environment is prepared.
If the availability-
placement is prohibited. This is necessary to
avoid various issues such as incorrectly load-
balancing ports across heterogenous services, and
makes it possible to unambiguously determine
which Cloud Service to assign units to for high
availability.
Description of the change
provider/azure: availability-
A new config attribute availability-
is defined, which controls the mode in which the
Azure environment operates. If true (the default),
availability set support is enabled and instances
will be grouped by service. The attribute cannot
be changed after the environment is prepared.
If the availability-
placement is prohibited. This is necessary to
avoid various issues such as incorrectly load-
balancing ports across heterogenous services, and
makes it possible to unambiguously determine
which Cloud Service to assign units to for high
availability.
Reviewers: mp+211863_ code.launchpad. net,
Message:
Please take a look.
Description: sets-enabled config
provider/azure: availability-
A new config attribute availability- sets-enabled
is defined, which controls the mode in which the
Azure environment operates. If true (the default),
availability set support is enabled and instances
will be grouped by service. The attribute cannot
be changed after the environment is prepared.
If the availability- sets-enabled is true, unit
placement is prohibited. This is necessary to
avoid various issues such as incorrectly load-
balancing ports across heterogenous services, and
makes it possible to unambiguously determine
which Cloud Service to assign units to for high
availability.
https:/ /code.launchpad .net/~axwalk/ juju-core/ azure-mode- nounitplacement /+merge/ 211863
Requires: /code.launchpad .net/~axwalk/ juju-core/ state-environca pability/ +merge/ 211749
https:/
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/77950045/
Affected files (+83, -2 lines): azure/config. go azure/config_ test.go azure/environ. go azure/environ_ test.go azure/environpr ovider. go
A [revision details]
M provider/
M provider/
M provider/
M provider/
M provider/
Index: [revision details]
=== 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: <email address hidden>
+New revision: <email address hidden>
Index: provider/ azure/config. go azure/config. go' azure/config. go 2014-03-10 20:22:44 +0000 azure/config. go 2014-03-20 04:44:57 +0000 certificate" : schema.String(), account- name": schema.String(), image-name" : schema.String(), sets-enabled" : schema.Bool(), certificate" : "", certificate- path": "", image-name" : "", sets-enabled is set to Omit (equivalent sets-enabled" : schema.Omit,
=== modified file 'provider/
--- provider/
+++ provider/
@@ -18,12 +18,16 @@
"management-
"storage-
"force-
+ "availability-
}
var configDefaults = schema.Defaults{
"location": "",
"management-
"management-
"force-
+ // availability-
+ // to false) for backwards compatibility.
+ "availability-
}
type azureEnvironConfig struct { "force- image-name" ].(string)
@@ -51,6 +55,11 @@
return cfg.attrs[
}
+func (cfg *azureEnvironCo nfig) availabilitySet sEnabled( ) bool { "availability- sets-enabled" ].(bool) vider) newConfig(cfg *config.Config) onfig, error) {
+ enabled, _ := cfg.attrs[
+ return enabled
+}
+
func (prov azureEnvironPro
(*azureEnvironC
validCfg, err := prov.Validate(cfg, nil)
if err != nil {
@@ -71,6 +80,13 @@
return nil, err
}
+ // User cannot change availability- sets-enabled after environment is AllAttrs( )["availability -sets-enabled" ] != )["availability -sets-enabled" ] { sets-enabled" ) nownAttrs( configFields, configDefaults)
prepared.
+ if oldCfg != nil {
+ if oldCfg.
cfg.AllAttrs(
+ return nil, fmt.Errorf("cannot change availability-
+ }
+ }
+
validated, err := cfg.ValidateUnk
if err != nil {
return nil, e...