Description:
Add constraints validation to providers
Each provider has a constraints validator which
is used when setting constraints on a machine or
service, as well as when constraints are merged.
The validation step allows conflicting constraints
like instance-type and mem to be rejected, and also
unsupported constraints to be logged with a warning.
The merge step allows things like instance-type to
mask other incompatible constraints like mem or arch,
and visa versa.
Affected files (+529, -61 lines):
A [revision details]
M environs/instances/image.go
M environs/interface.go
M environs/statepolicy.go
M provider/azure/environ.go
M provider/azure/environ_test.go
M provider/dummy/environs.go
M provider/ec2/ec2.go
M provider/ec2/local_test.go
M provider/joyent/environ_instance.go
M provider/joyent/local_test.go
M provider/local/environ.go
M provider/local/environ_test.go
M provider/maas/environ.go
M provider/maas/environ_test.go
M provider/manual/environ.go
M provider/manual/environ_test.go
M provider/openstack/local_test.go
M provider/openstack/provider.go
M state/addmachine.go
M state/conn_test.go
M state/constraints.go
A state/constraintsvalidation_test.go
M state/export_test.go
M state/machine.go
M state/machine_test.go
M state/policy.go
M state/service.go
M state/service_test.go
M state/state_test.go
Reviewers: mp+216244_ code.launchpad. net,
Message:
Please take a look.
Description:
Add constraints validation to providers
Each provider has a constraints validator which
is used when setting constraints on a machine or
service, as well as when constraints are merged.
The validation step allows conflicting constraints
like instance-type and mem to be rejected, and also
unsupported constraints to be logged with a warning.
The merge step allows things like instance-type to
mask other incompatible constraints like mem or arch,
and visa versa.
https:/ /code.launchpad .net/~wallyworl d/juju- core/instance- type-constraint /+merge/ 216244
Requires: /code.launchpad .net/~wallyworl d/juju- core/constraint s-validation- merge/+ merge/215807
https:/
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/88780043/
Affected files (+529, -61 lines): instances/ image.go interface. go statepolicy. go azure/environ. go azure/environ_ test.go dummy/environs. go ec2/local_ test.go joyent/ environ_ instance. go joyent/ local_test. go local/environ. go local/environ_ test.go maas/environ. go maas/environ_ test.go manual/ environ. go manual/ environ_ test.go openstack/ local_test. go openstack/ provider. go ts.go tsvalidation_ test.go test.go test.go test.go
A [revision details]
M environs/
M environs/
M environs/
M provider/
M provider/
M provider/
M provider/ec2/ec2.go
M provider/
M provider/
M provider/
M provider/
M provider/
M provider/
M provider/
M provider/
M provider/
M provider/
M provider/
M state/addmachine.go
M state/conn_test.go
M state/constrain
A state/constrain
M state/export_
M state/machine.go
M state/machine_
M state/policy.go
M state/service.go
M state/service_
M state/state_test.go