infrakit: rename the Moby property to kernel+initrd

The infrakit plugin is not specific to Moby and should be able
to boot other Linux systems as long as a kernel image and
initial RAM disk are supplied. Reflect this in the property
passed to the plugin.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
This commit is contained in:
Rolf Neugebauer 2017-04-10 16:12:08 +01:00
parent 70a27b667e
commit 34af633552
3 changed files with 7 additions and 6 deletions

View File

@ -13,7 +13,7 @@
"Instance": {
"Plugin": "instance-hyperkit",
"Properties": {
"Moby": "etcd",
"kernel+initrd": "etcd",
"Disk" : 1024,
"CPUs" : 1,
"Memory" : 1024

View File

@ -7,7 +7,8 @@
"Instance": {
"Plugin": "instance-hyperkit",
"Properties": {
"Moby": "../../moby",
"_comment" : "kernel+initrd specifies the prefix as in <prefix>-bzImage and <prefix>-initrd.img",
"kernel+initrd": "linux",
"Disk" : 512,
"CPUs" : 2,
"Memory" : 1024

View File

@ -54,8 +54,8 @@ func (p hyperkitPlugin) Provision(spec instance.Spec) (*instance.ID, error) {
}
}
if properties["Moby"] == nil {
return nil, errors.New("Property 'Moby' must be set")
if properties["kernel+initrd"] == nil {
return nil, errors.New("Property 'kernel+initrd' must be set")
}
if properties["CPUs"] == nil {
properties["CPUs"] = 1
@ -122,8 +122,8 @@ func (p hyperkitPlugin) Provision(spec instance.Spec) (*instance.ID, error) {
if err != nil {
return nil, err
}
h.Kernel = properties["Moby"].(string) + "-bzImage"
h.Initrd = properties["Moby"].(string) + "-initrd.img"
h.Kernel = properties["kernel+initrd"].(string) + "-bzImage"
h.Initrd = properties["kernel+initrd"].(string) + "-initrd.img"
h.UUID = uuidStr
h.DiskImage = diskImage
h.ISOImage = isoImage