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

Snap components #2166

Merged
merged 5 commits into from
Feb 25, 2025
Merged

Snap components #2166

merged 5 commits into from
Feb 25, 2025

Conversation

dbungert
Copy link
Collaborator

No description provided.

Specify nvidia 510 to for dry-run drivers matching purposes.

Co-authored-by: Dan Bungert <[email protected]>
@dbungert
Copy link
Collaborator Author

FFE: LP:#2099950

Copy link
Contributor

@Chris-Peterson444 Chris-Peterson444 left a comment

Choose a reason for hiding this comment

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

One inline comment but everything else looks great to me, thanks!

Comment on lines +245 to +249
def snap_of_type(self, typ: ModelSnapType) -> Optional[ModelSnap]:
for snap in self.snaps:
if snap.type == typ:
return snap
return None
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: this only gets the first of the type in the list. From the name and usage it seems expected that there's only one of this type, which is true for the kernel (could we ever have more?), but it wouldn't work for say typ=ModelSnapType.APP where we already have multiple.

I think instead we want something like:

Suggested change
def snap_of_type(self, typ: ModelSnapType) -> Optional[ModelSnap]:
for snap in self.snaps:
if snap.type == typ:
return snap
return None
def snaps_of_type(self, typ: ModelSnapType) -> List[ModelSnap]:
return [snap for snap in self.snaps if snap.type == typ]

and have the caller make the assertion about the number of them?

I wouldn't say it's blocking and think it's fine to fix this in a follow up though.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

If we had the scenario of multiple recommended drivers, and matching
component versions, prefer the newer ones.
@dbungert dbungert merged commit ecdd31d into canonical:main Feb 25, 2025
10 checks passed
@dbungert dbungert deleted the snap-components branch February 25, 2025 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants