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

Allow reverting a deleted Munki. #15183

Merged
merged 1 commit into from
Nov 17, 2023
Merged

Conversation

getvictor
Copy link
Member

When Munki is deleted and reinstalled on the host, Fleet will show Munki info again.
#12409

Checklist for submitter

  • Changes file added for user-visible changes in changes/ or orbit/changes/.
    See Changes files for more information.
  • Added/updated tests
  • Manual QA for all new/changed functionality

Copy link

codecov bot commented Nov 16, 2023

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (41c2ebf) 59.04% compared to head (d2bdad6) 59.04%.

Files Patch % Lines
server/service/osquery_utils/queries.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #15183   +/-   ##
=======================================
  Coverage   59.04%   59.04%           
=======================================
  Files         965      965           
  Lines       81985    81985           
  Branches     2277     2277           
=======================================
  Hits        48405    48405           
  Misses      29851    29851           
  Partials     3729     3729           
Flag Coverage Δ
backend 59.67% <33.33%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@getvictor getvictor marked this pull request as ready for review November 16, 2023 22:54
@getvictor getvictor requested a review from a team as a code owner November 16, 2023 22:54
// assume the extension is not there
return nil
// munki is not there, and we need to mark it deleted if it was there before
return ds.SetOrUpdateMunkiInfo(ctx, host.ID, "", []string{}, []string{})
Copy link
Member Author

Choose a reason for hiding this comment

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

The query select <stuff> from munki_info is part of detail query which is hardcoded in fleetd on the host. If Munki doesn't exist (or was completely wiped) on the host, the query will return no rows. The server will see that as it is processing detail query results from the host.

Copy link
Member

@lucasmrod lucasmrod left a comment

Choose a reason for hiding this comment

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

LGTM!

@getvictor getvictor merged commit 91ee14f into main Nov 17, 2023
@getvictor getvictor deleted the 12409-allow-to-revert-deleted-munki branch November 17, 2023 18:21
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.

2 participants