Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix VM image import/export #6515

Merged
merged 7 commits into from Nov 26, 2019
Merged

Fix VM image import/export #6515

merged 7 commits into from Nov 26, 2019

Conversation

@stgraber
Copy link
Member

stgraber commented Nov 26, 2019

No description provided.

@@ -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.

Copy link
@tomponline

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.

Copy link
@stgraber

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.

Copy link
@tomponline

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.

Copy link
@tomponline

This comment has been minimized.

Copy link
@stgraber

stgraber Nov 26, 2019

Author Member

See above

@@ -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.

Copy link
@stgraber

stgraber Nov 26, 2019

Author Member

See above

@stgraber stgraber force-pushed the stgraber:vm branch from dc67b89 to 4cbeeab Nov 26, 2019
shared/archive.go Outdated Show resolved Hide resolved
@stgraber stgraber force-pushed the stgraber:vm branch from 4cbeeab to 721a80f Nov 26, 2019
stgraber added 7 commits Nov 26, 2019
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>
@stgraber stgraber force-pushed the stgraber:vm branch from 721a80f to 82ade4b Nov 26, 2019
@stgraber

This comment has been minimized.

Copy link
Member Author

stgraber commented Nov 26, 2019

jenkins: test this please

@lxc-jenkins

This comment has been minimized.

Copy link

lxc-jenkins commented Nov 26, 2019

Testsuite passed

@brauner brauner merged commit 4b98b7d into lxc:master Nov 26, 2019
3 of 5 checks passed
3 of 5 checks passed
Testsuite Test started
Details
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
Branch target Branch target is correct
Details
DCO All commits signed-off
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
@tomponline

This comment has been minimized.

Copy link
Member

tomponline commented on a9ea95e Nov 27, 2019

@stgraber did you intend to commit the testimage.tar.xz image with this change?

@stgraber

This comment has been minimized.

Copy link
Member Author

stgraber commented Nov 27, 2019

@tomponline most certainly did not... will fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
4 participants
You can’t perform that action at this time.