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

seed/seedwriter: consider modes when checking for deps availability #9710

Merged
merged 3 commits into from Nov 30, 2020

Conversation

pedronis
Copy link
Collaborator

the code before wasn't taking into account the modes in which
the base or default content providers were available vs
the modes of the dependent snap, with the changes here
it now does

fixes LP: #1883970

the code before wasn't taking into account the modes in which
the base or default content providers were available vs
the modes of the dependent snap, with the changes here
it now does
@pedronis pedronis added UC20 Run nested The PR also runs tests inluded in nested suite labels Nov 27, 2020
Copy link
Collaborator

@mvo5 mvo5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this fix

Copy link
Collaborator

@bboozzoo bboozzoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

if mode == "run" || mode == "ephemeral" {
return false
}
// consider ephemeral as well
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we could extend the comment a bit, eg.

// all non-run modes (eg. recover) are considered ephemeral,
// as a fallback check if the snap is listed for an ephemeral mode

byMode := availableByMode[mode]
if !byMode.Contains(snapRef) {
if mode == "run" || mode == "ephemeral" {
return false
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// no additional fallback check for well known modes

@@ -90,6 +90,13 @@ type SeedSnap struct {
optionSnap *OptionsSnap
}

func (sn *SeedSnap) modes() []string {
if sn.modelSnap == nil {
return []string{"run"}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// default mode for extra snaps not listed in the model

@pedronis pedronis merged commit c5ced56 into snapcore:master Nov 30, 2020
Copy link
Member

@anonymouse64 anonymouse64 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this, post-merge LGTM from me

@pedronis pedronis deleted the seedwriter-check-modes-for-deps branch December 1, 2020 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Run nested The PR also runs tests inluded in nested suite
Projects
None yet
4 participants