Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upFix VM image import/export #6515
Conversation
@@ -336,6 +336,9 @@ type ImageCreateArgs struct { | |||
|
|||
// Progress handler (called with upload progress) | |||
ProgressHandler func(progress ioprogress.ProgressData) | |||
|
|||
// Type of the image (container or virtual-machine) | |||
Type string |
This comment has been minimized.
This comment has been minimized.
tomponline
Nov 26, 2019
Member
@stgraber is it worth making this type InstanceType
from the api
package?
https://github.com/lxc/lxd/blob/master/shared/api/instance.go#L8-L17
This will then self document the allowed values.
This comment has been minimized.
This comment has been minimized.
stgraber
Nov 26, 2019
Author
Member
I'm not sure about that one yet. So far all the images type stuff has been done using strings, not using InstanceType. Part of the reason behind this was that, well, they're not instances.
I think it's probably best to go as is and if we decide that we should use InstanceType for images too, then we can do one change which converts everything in one go.
This comment has been minimized.
This comment has been minimized.
tomponline
Nov 27, 2019
Member
@stgraber ah yeah that makes sense, maybe we could have some constants defining image types for now and then it would make finding them easier later (and avoiding typos).
@@ -387,7 +387,11 @@ func (r *ProtocolLXD) CreateImage(image api.ImagesPost, args *ImageCreateArgs) ( | |||
} | |||
|
|||
// Rootfs file | |||
fw, err = w.CreateFormFile("rootfs", args.RootfsName) | |||
if args.Type == "virtual-machine" { |
This comment has been minimized.
This comment has been minimized.
tomponline
Nov 26, 2019
Member
@stgraber can you use the constant here for this? https://github.com/lxc/lxd/blob/master/shared/api/instance.go#L17
This comment has been minimized.
This comment has been minimized.
@@ -726,6 +726,7 @@ func (c *cmdImageImport) Run(cmd *cobra.Command, args []string) error { | |||
Quiet: c.global.flagQuiet, | |||
} | |||
|
|||
imageType := "container" |
This comment has been minimized.
This comment has been minimized.
tomponline
Nov 26, 2019
Member
@stgraber this constant could be used here https://github.com/lxc/lxd/blob/master/shared/api/instance.go#L14
This comment has been minimized.
This comment has been minimized.
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
This comment has been minimized.
This comment has been minimized.
jenkins: test this please |
This comment has been minimized.
This comment has been minimized.
lxc-jenkins
commented
Nov 26, 2019
Testsuite passed |
This comment has been minimized.
This comment has been minimized.
@stgraber did you intend to commit the testimage.tar.xz image with this change? |
This comment has been minimized.
This comment has been minimized.
@tomponline most certainly did not... will fix. |
stgraber commentedNov 26, 2019
No description provided.