Hi Fleet team, could u tell me how does fleet fetc...
# fleet
Hi Fleet team, could u tell me how does fleet fetch the version of osquery, i have a osquery pkg built by myself following the standard Debian requirement. and fleet telling that with some weird content as showing below.
Fleet gets that from osquery. It’s being set when osquery is built, based on info pulled from git: https://github.com/osquery/osquery/blob/030e7af09f310101e0ef8da99c8288239ba2e7d9/cmake/options.cmake#L14
thx, but i dont understand the logic in the code from the link, maybe could u help to explain the logic?
When the build process runs,
git describe
is run to get the most recent tag. The
flag allows for
to be detected as tags. The
flag allows for a commit to be used if both of those fail. The
flag adds an indicator if there are local changes (which you're seeing in your version). So what you're seeing there is the most recent tag, then the most recent commit after the tag, then the
suffix to show that there were local changes when the build was run.
That allows you to reference the exact state of the code when the build happened.
Any additional questions about this would be best posted in the #general channel. That way, you've got the larger osquery community to help you out rather than just those that also check this channel 🙂
@Kathy Satterlee one more question, why the standard building process pkg osquery has different val of this field?
If I understand the question properly, it's because generally the version you're building is a tagged release, so there are no additional commits and only the tag is returned.
If I built right now from the
branch of osquery, the version I'd get would be
If I made some changes before the build without committing, it would be
The version accurately reflects the exact state of the code when
is built.
ok i got it, but this isnot what i want
Gotcha. Since this isn't directly related to Fleet, the best bet at this point would be to reach out to the wider community over in #general to see if anyone can suggest ways to set a custom version number or change that logic.