-
Notifications
You must be signed in to change notification settings - Fork 669
guestagent refactoring #3504
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
guestagent refactoring #3504
Conversation
80cd346
to
7c208a5
Compare
res, err := newest([]string{comp, uncomp}) | ||
if err != nil { | ||
logrus.Debug(err) | ||
return "", fmt.Errorf("guest agent binary could not be found for %s-%s (Hint: try installing `lima-additional-guestagents` package)", ostype, arch) |
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.
lima-additional-guestagents is being packaged in:
I'm not a fan of using file modification time to determine which file is newer. Modification time represents the time when a file was build / packaged / downloaded, so a newer file could very well be an older version. I'm not sure which scenario this is supposed to address; why would somebody have both a compressed and an uncompressed version? Does this only happen for Lima developers / maintainers, or can regular users run into this situation. I would prefer to treat this as an error, and make the user delete one of the files to resolve the ambiguity. |
Regular users may hit this when unpacking v1.1.x.tar.gz (tentative) after unpacking v1.0.x.tar.gz |
In that case I would still prefer that we will always pick the compressed version, if available, and show a warning when both exist, with a suggestion to delete the uncompressed one. And with 1.1.0 going forward we should only be releasing the compressed version. |
7c208a5
to
50a3eb8
Compare
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.
Thanks, LGTM
Only one comment looks off
pkg/infoutil/infoutil.go
Outdated
) | ||
|
||
type Info struct { | ||
Version string `json:"version"` | ||
Templates []templatestore.Template `json:"templates"` | ||
DefaultTemplate *limayaml.LimaYAML `json:"defaultTemplate"` | ||
LimaHome string `json:"limaHome"` | ||
VMTypes []string `json:"vmTypes"` // since Lima v0.14.2 | ||
VMTypes []string `json:"vmTypes"` // since Lima v0.14.2 | ||
GuestAgents map[limayaml.Arch]string `json:"guestAgents"` // since Lima v1.1.10 |
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.
GuestAgents map[limayaml.Arch]string `json:"guestAgents"` // since Lima v1.1.10 | |
GuestAgents map[limayaml.Arch]string `json:"guestAgents"` // since Lima v1.1.0 |
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.
Fixed.
Also changed string
to GuestAgent
struct for extensibility
When both `lima-guestagent.Linux-<ARCH>` and `lima-guestagent.Linux-<ARCH>.gz` are present, the compressed one is chosen with a warning. Preparation for issue 3325 Signed-off-by: Akihiro Suda <[email protected]>
Signed-off-by: Akihiro Suda <[email protected]>
Signed-off-by: Akihiro Suda <[email protected]>
50a3eb8
to
008aca9
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, LGTM
Commit 1: guestagent: prioritize BIN.gz over BIN
When both
lima-guestagent.Linux-<ARCH>
andlima-guestagent.Linux-<ARCH>.gz
are present, the compressed one is chosen with a warning.Preparation for:
GUESTAGENT_COMPRESS=y
by default #3325Commit 2: limactl info: show the detected guest agent paths
Commit 3: hostagent: verify existence of guestagent earlier