Series support
Tim Penhey
tim.penhey at canonical.com
Wed Mar 13 01:18:14 UTC 2013
Hi William,
tl;dr - proposal and questions repeated at the end of the email.
Note: I've tagged all series tasks with "series" for nice filtering.
As mostly expected, I start looking at this work and feel blocked by
questions :-) This email is a little rambly...
I'll see if I can enumerate enough of them to get started effectively.
Part of this is kinda like a pre-implementation check, as I have a few
ideas which may or may not make real sense.
The first card I have assigned looks like two very separate branches:
* add series to environs interface (instance launching, includes
bootstrap)
- add series to envrons.Bootstrap
- taking tools out of the interface
Now I started looking at this again, and it almost makes sense, although
I am confused by what is meant by "environs interface". Does it mean:
add a function "Series() string" to the interface environs.Environ
(which would seem weird)? Or does it mean that we add it to the
environs.config? Which already seems to have a DefaultSeries().
so... environs.Bootstrap takes the following params:
environ Environ
uploadTools bool
writeCertAndKey func(environName string, cert, key []byte) error
First thing I suggest is that we take the write function out, and make
it an explicit thing in the bootstrap command itself (in
cmd/juju/bootstrap).
This cleans up all the call-sites which reimplement panicWrite (6 times!).
Which leads to the first question:
Given that we panic in environs.Bootstrap if there is a CA private key
but no certificate, what do we expect the user to do with this
information? Also interesting to note that the function currently
thinks it is fine if there is a CA Cert but no CA private key - is this
valid?
Next, looking back at the suggested work, it says to take upload tools
out of the Bootstrap params. Where do we move it to? Is it a function
on the environment itself instead of a weird parameter to the
environs.Bootstrap function. This would have no impact on the actual
command function except it would do something like:
if c.UploadTools {
environ.UploadTools()
}
return environs.Bootstrap(environ, c.Series)
So... back to the series param, if we have a string param to
environs.Bootstrap, I'm assuming we should allow the bootstrap command
CLI to allow setting it. And we pass through the requested series
through, and it will end up with the provider looking to see if it is
empty, and if so, use the default-series?
I think I've talked (or typed) myself into a reasonable understanding,
and summarised below:
Work Summary:
* Move cert creation and writing to the bootstrap command
* environs.Bootstrap errors out if no CA Cert defined or no CA Key defined
* Add "UploadTools" to the Environ interface, and remove the parameter
from Bootstrap function.
* Add a "series string" parameter to environs.Bootstrap, which then gets
passed through to Environ.Bootstrap.
Questions:
* Is it valid to have a CA Cert but no CA private key?
* If we make an UploadTools method on environs.Environ, should it take a
series parameter?
* Should environs.Environ.Bootstrap be:
Bootstrap(series string, stateServerCert, stateServerKey []byte) error
or
Bootstrap(stateServerCert, stateServerKey []byte, series string) error
Sound sane?
Tim
More information about the Juju-dev
mailing list