Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Provision loop devices #15
Conversation
wallyworld
added some commits
Jan 28, 2015
axw
reviewed
Jan 28, 2015
| @@ -532,8 +532,9 @@ func (p *ProvisionerAPI) machineVolumeParams(m *state.Machine) ([]storage.Volume | ||
| return nil, errors.Errorf("cannot get parameters for volume %q", dev.Name()) | ||
| } | ||
| var options map[string]interface{} | ||
| + var providerType storage.ProviderType | ||
| if params.Pool != "" { |
axw
Jan 28, 2015
Collaborator
I think we guarantee that Pool != "" now right? We should be able to drop this test.
axw
reviewed
Jan 28, 2015
| pm := pool.NewPoolManager(state.NewStateSettings(st)) | ||
| p, err := pm.Get(poolName) | ||
| if err != nil { | ||
| - return nil, errors.Trace(err) | ||
| + return storage.ProviderType(""), nil, errors.Trace(err) |
axw
Jan 28, 2015
Collaborator
what's the point of typing the ""?
EDIT: as in, why not just use untyped string, ""?
axw
reviewed
Jan 28, 2015
| @@ -26,6 +26,9 @@ type VolumeParams struct { | ||
| // as defined in a storage pool. | ||
| Options map[string]interface{} | ||
| + // The provider type for this volume. | ||
| + VolumeType ProviderType |
axw
Jan 28, 2015
Collaborator
I think just call the field Provider. Or ProviderType. VolumeType sounds more like the EBS volume type.
axw
reviewed
Jan 28, 2015
| + | ||
| +var _ Provisioner = (*storageProvisioner)(nil) | ||
| + | ||
| +// TODO - add tests |
axw
Jan 28, 2015
Collaborator
Not sure there's any point, because this all needs to change pretty significantly.
axw
reviewed
Jan 28, 2015
| + | ||
| +func (p *storageProvisioner) loop() error { | ||
| + // TODO - this is a hack. | ||
| + // Provision initial storage for loop devices. |
axw
Jan 28, 2015
Collaborator
In case there's any doubt, this is a major hack. We shouldn't be using the machine provisioner API, and we shouldn't be using the machine provisioning info. Instead, we should be watching all unprovisioned storage instances.
|
LGTM, with a few minor changes. I may make some changes tomorrow to enable dynamic provisioning of EBS volumes. |
wallyworld commentedJan 28, 2015
Very initial, POC machine storage provisioner for loop devices.