-
Notifications
You must be signed in to change notification settings - Fork 574
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
o/snapstate: install components and snaps from file #14095
o/snapstate: install components and snaps from file #14095
Conversation
0651aa2
to
fdfee01
Compare
fdfee01
to
03f2877
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.
I'm not sure if the code opening the component is doing enough validation, if I look at the similar path for the snap there's more validation going on
overlord/snapstate/target.go
Outdated
func installableComponentsFromPaths(info *snap.Info, components map[*snap.ComponentSideInfo]string) ([]ComponentSetup, error) { | ||
setups := make([]ComponentSetup, 0, len(components)) | ||
for csi, path := range components { | ||
compInfo, _, err := backend.OpenComponentFile(path, info, csi) |
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.
shouldn't this do something more similar to validatedInfoFromPathAndSideInfo ?
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.
Yes, resolved in 88890b7.
…g from ephemeral files
301c185
to
88890b7
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.
Some minor comments
// if we're removing the snap file and we are mounting a component for the | ||
// firs time, then we know that the component also must be coming from an | ||
// emphemeral file. in that case, remove it. | ||
if snapsup.RemoveSnapPath { |
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.
Maybe we should add the flags from componentInstallFlags
to ComponentSetup
and check that instead?
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.
Done in fef6953.
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.
but this is code still the same? what am I missing
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.
Sorry, missed that in the commit.
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.
thank you for the changes, some further comments
// if we're removing the snap file and we are mounting a component for the | ||
// firs time, then we know that the component also must be coming from an | ||
// emphemeral file. in that case, remove it. | ||
if snapsup.RemoveSnapPath { |
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.
but this is code still the same? what am I missing
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.
thank you
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.
LGTM, thanks for the changes
This allows us to install snaps and components from files at the same time. Based on #14092, first commit is 12afed2.