-
Notifications
You must be signed in to change notification settings - Fork 103
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
[TUF autoupdater] Remove osquery client dependency #1178
[TUF autoupdater] Remove osquery client dependency #1178
Conversation
33d99ff
to
eb6832e
Compare
|
||
// IsInstallVersion checks whether the version in the given target is the same as the one | ||
// contained in the installation. | ||
func (ulm *updateLibraryManager) IsInstallVersion(binary autoupdatableBinary, targetFilename string) bool { |
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.
Hrm. So how will this get used?
- installed as 1.0.8
- upgraded to 1.0.9
- downgraded to 1.0.8
So what is executed?
My gut sense is that the complexity isn't worth it, and just downloading 1.0.8 is fine
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.
Pulled it out, more trouble than it was worth!
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.
Having slept on it... I think we need something here.
There's a case that's like:
- installed as 1.0.8
- stable is 1.0.8
- download 1.0.8
And that feels kinda -_-
Bt my inclination would be to push the initial versioning to main
or potentially even the packaging layer.
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.
Main might be clean enough. I think the hardest part here was the find-binary code. And main / extension setup should know that
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 feel like I'm talking myself in circles here. I'm sorry the requirements aren't more clear.
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've just wrapped up this commit 72db950, which I think handles what we're talking about:
- install version is 1.0.8
- current running version is therefore 1.0.8
- there is no update downloaded for 1.0.8
- we see that current running version is 1.0.8 so we don't perform the download
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 I understand all the nuance here, but the code feels like the right shape.
Relates to #954.
This PR extracts the osquerier dependency from the library, so that we can init the library before we have an osquery client.
It also pulls out a shared function for sorting versions in the library for reuse later.
Adds a small amount of documentation about how to generate mocks with mockery, since it's done in a slightly non-standard way in this package.
Future work + linked PRs
Subsequent PRs will tackle the following (order is not set in stone):
<binary>/<os>/<arch>/<channel>/release.json
, once availablefindNew
); launcher performs library tidying after version selectionautoupdate/tuf
out into its own package)Previous work: