-
Notifications
You must be signed in to change notification settings - Fork 931
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
lxc: Check the image really exists on the remote before exporting it #13161
lxc: Check the image really exists on the remote before exporting it #13161
Conversation
df91a4e
to
1e583c4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which call was actually trying to access the local filesystem?
This seems like a sticking plaster rather than fixing the call that tried to access the filesystem incorrectly? I may be misunderstanding.
I don't know if this explanation makes sense :) |
Yes this makes sense now thanks. So my question now is whether we should change I'm not too happy to see the errors being ignored in What do you think? |
I like this solution. Let's do that. |
05ce438
to
2c35ef7
Compare
9c74a64
to
ad29046
Compare
ad29046
to
b768300
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi
Thanks, but please see #13161 (comment) as we agreed that dereferenceAlias
would return the equivalent of GetImage
by calling it inside once it had resolved the alias.
Then we would remove extra unnecessary calls to GetImage
that occur after it.
270ddf2
to
2438684
Compare
Should be updated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking a lot clearer thanks
Signed-off-by: Gabriel Mougard <gabriel.mougard@canonical.com>
Signed-off-by: Gabriel Mougard <gabriel.mougard@canonical.com>
2438684
to
aeb045a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Awesome, thanks! |
closes #12725
When doing a
lxc image export ..
, dereferencing the provided image name either returns a fingerprint or a human readable alias. Both forms can be fine. However, since thisdereferenceAlias
operation is not really checking if the image associated with this alias exists on the remote, we were creating a local target based on the same string that a user entered. Most of the time, thistargetMeta
string was resolved to a fingerprint (e.g,/var/lib/snapd/hostfs/home/gab/d2a43fade9d0055e454a091b2e9bd819f7eb715a3d4d46667644a5784d40172
) and this was fine because there is only the fingerprint file created and no intermediate directories.Anyway, I think it is safer to systematically check for the image existence prior to creating any file resources. This way we avoid changing the filesystem write logic that could annoy exsting users and break their export image pipeline: