Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(297)

Issue 13632046: all: introduce environs.Prechecker

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 1 month ago by axw
Modified:
12 years, 1 month ago
Reviewers:
mp+185015, axw1, jameinel, fwereade, thumper
Visibility:
Public.

Description

all: introduce environs.Prechecker This introduces a new interface, environs.Prechecker, which is an optional interface that an environs.Environ may implement. Prechecker has two methods: PrecheckInstance and PrecheckContainer. These methods will check if constraints can possibly be met by the environment. They will be used to check if an environment is capable of creating an instance with the specified series and constraints, or container with the specified type. If the methods return nil, that does not necessarily mean that the constraints are satisfied; if a non-nil error is returned, then it means that the constraints are definitely not satisfiable. The local, ec2, azure and openstack Environ implementatons will now disallow creating containers. When the work to support addressability is done, this needs to be changed. Currently, maas lets everything through. The interface is not currently used anywhere. This will be done in a followup. https://code.launchpad.net/~axwalk/juju-core/sanity-check-constraints/+merge/185015 (do not edit description out of merge proposal)

Patch Set 1 #

Patch Set 2 : all: implements Environ.SanityCheckConstraints #

Total comments: 16

Patch Set 3 : all: implements Environ.SanityCheckConstraints #

Patch Set 4 : all: introduce environs.Preflighter #

Patch Set 5 : all: introduce environs.Preflighter #

Total comments: 8

Patch Set 6 : all: introduce environs.Prechecker #

Total comments: 10

Patch Set 7 : all: introduce environs.Prechecker #

Patch Set 8 : all: introduce environs.Prechecker #

Total comments: 3

Patch Set 9 : all: introduce environs.Prechecker #

Unified diffs Side-by-side diffs Delta from patch set Stats (+291 lines, -13 lines) Patch
A [revision details] View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -0 lines 0 comments Download
M environs/interface.go View 1 2 3 4 5 6 7 1 chunk +22 lines, -0 lines 0 comments Download
M environs/jujutest/livetests.go View 1 2 3 4 5 6 7 2 chunks +22 lines, -0 lines 0 comments Download
M errors/errors.go View 1 2 3 4 5 6 7 8 4 chunks +37 lines, -13 lines 0 comments Download
A errors/errors_test.go View 1 2 3 4 5 6 7 8 1 chunk +107 lines, -0 lines 0 comments Download
M provider/azure/environ.go View 1 2 3 4 5 6 7 2 chunks +13 lines, -0 lines 0 comments Download
M provider/azure/environ_test.go View 1 2 3 4 5 6 1 chunk +9 lines, -0 lines 0 comments Download
M provider/ec2/ec2.go View 1 2 3 4 5 6 7 2 chunks +13 lines, -0 lines 0 comments Download
M provider/ec2/local_test.go View 1 2 3 4 5 6 7 1 chunk +10 lines, -0 lines 0 comments Download
M provider/local/environ.go View 1 2 3 4 5 6 7 2 chunks +13 lines, -0 lines 0 comments Download
M provider/local/environ_test.go View 1 2 3 4 5 6 7 2 chunks +19 lines, -0 lines 0 comments Download
M provider/maas/environ.go View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M provider/openstack/local_test.go View 1 2 3 4 5 6 7 1 chunk +10 lines, -0 lines 0 comments Download
M provider/openstack/provider.go View 1 2 3 4 5 6 7 2 chunks +13 lines, -0 lines 0 comments Download

Messages

Total messages: 29
axw
Please take a look.
12 years, 1 month ago (2013-09-11 10:56:45 UTC) #1
axw
Please take a look.
12 years, 1 month ago (2013-09-11 11:00:32 UTC) #2
jameinel
Because this is being added to the environs interface we should have a test added ...
12 years, 1 month ago (2013-09-11 12:05:59 UTC) #3
fwereade
General +1 to jam's comments. It looks to me like deploy/add-unit and add-machine go through ...
12 years, 1 month ago (2013-09-11 14:43:35 UTC) #4
fwereade
Hmm, further to my previous comments... we shouldn't be calling SanityCheckConstraints *quite* so early; it'll ...
12 years, 1 month ago (2013-09-11 16:17:54 UTC) #5
fwereade
On 2013/09/11 16:17:54, fwereade wrote: > Hmm, further to my previous comments... we shouldn't be ...
12 years, 1 month ago (2013-09-11 16:20:46 UTC) #6
axw1
On 2013/09/11 12:05:59, jameinel wrote: > Because this is being added to the environs interface ...
12 years, 1 month ago (2013-09-12 05:22:43 UTC) #7
axw1
On 2013/09/11 16:17:54, fwereade wrote: > Hmm, further to my previous comments... we shouldn't be ...
12 years, 1 month ago (2013-09-12 06:06:14 UTC) #8
axw1
On 2013/09/11 16:20:46, fwereade wrote: > On 2013/09/11 16:17:54, fwereade wrote: > > Hmm, further ...
12 years, 1 month ago (2013-09-12 06:12:14 UTC) #9
axw1
https://codereview.appspot.com/13632046/diff/4001/cmd/juju/addmachine.go File cmd/juju/addmachine.go (right): https://codereview.appspot.com/13632046/diff/4001/cmd/juju/addmachine.go#newcode106 cmd/juju/addmachine.go:106: if err = conn.Environ.SanityCheckConstraints(checkConstraints); err != nil { On ...
12 years, 1 month ago (2013-09-12 06:21:15 UTC) #10
axw
Please take a look.
12 years, 1 month ago (2013-09-12 06:24:00 UTC) #11
fwereade
OK, I'm sorry I didn't express this well before, but it only just clicked: this ...
12 years, 1 month ago (2013-09-13 08:17:48 UTC) #12
axw1
On 2013/09/13 08:17:48, fwereade wrote: > OK, I'm sorry I didn't express this well before, ...
12 years, 1 month ago (2013-09-13 08:35:28 UTC) #13
axw
Please take a look.
12 years, 1 month ago (2013-09-17 07:11:47 UTC) #14
axw
Please take a look.
12 years, 1 month ago (2013-09-18 10:20:10 UTC) #15
thumper
On 2013/09/13 08:35:28, axw1 wrote: > On 2013/09/13 08:17:48, fwereade wrote: > > package instance ...
12 years, 1 month ago (2013-09-18 22:37:26 UTC) #16
thumper
If we consider what the preflight check is for, it is to validate or vet ...
12 years, 1 month ago (2013-09-18 23:04:07 UTC) #17
axw1
I have renamed the interface to Prechecker, and created separate methods for checking machine and ...
12 years, 1 month ago (2013-09-19 02:41:05 UTC) #18
axw
Please take a look.
12 years, 1 month ago (2013-09-19 02:44:05 UTC) #19
thumper
On 2013/09/19 02:44:05, axw wrote: > Please take a look. LGTM, although I do wonder ...
12 years, 1 month ago (2013-09-20 03:19:24 UTC) #20
axw1
On 2013/09/20 03:19:24, thumper wrote: > On 2013/09/19 02:44:05, axw wrote: > > Please take ...
12 years, 1 month ago (2013-09-20 03:54:37 UTC) #21
fwereade
Sorry for the delay... my eyes somehow slid right past it several times, I think. ...
12 years, 1 month ago (2013-09-23 14:36:10 UTC) #22
axw1
Thanks for the review. I've removed the series from PrecheckContainer, too. Let me know if ...
12 years, 1 month ago (2013-09-24 04:16:10 UTC) #23
axw
Please take a look.
12 years, 1 month ago (2013-09-24 05:08:49 UTC) #24
axw
Please take a look.
12 years, 1 month ago (2013-09-24 06:32:55 UTC) #25
fwereade
LGTM, thanks. https://codereview.appspot.com/13632046/diff/49001/environs/interface.go File environs/interface.go (right): https://codereview.appspot.com/13632046/diff/49001/environs/interface.go#newcode152 environs/interface.go:152: PrecheckContainer(series string, kind instance.ContainerType) error I'm easy ...
12 years, 1 month ago (2013-09-26 07:37:53 UTC) #26
axw1
Thank you. I'll add direct tests for the coreerrors changes. https://codereview.appspot.com/13632046/diff/49001/errors/errors.go File errors/errors.go (right): https://codereview.appspot.com/13632046/diff/49001/errors/errors.go#newcode127 ...
12 years, 1 month ago (2013-09-26 07:41:03 UTC) #27
axw
Please take a look.
12 years, 1 month ago (2013-09-26 08:49:40 UTC) #28
axw1
12 years, 1 month ago (2013-09-26 08:55:50 UTC) #29
On 2013/09/26 08:49:40, axw wrote:
> Please take a look.

Added some tests, and fixed a bug in an existing error constructor ;)

Will land now.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b