Add fleetctl upgrade-packs command to migrate 2017 packs to queries - #13078
Conversation
|
|
||
| // expects a global query for p1 (targets a label) and per-team queries for p2 (t1 and t2) | ||
| b, err := os.ReadFile(filepath.Join("testdata", "expectedUpgradePacks.yml")) | ||
| require.NoError(t, err) |
There was a problem hiding this comment.
For a reason I can't understand right now, this fails constantly on CI (but passes locally) with this error:
=== RUN TestFleetctlUpgradePacks_NonEmpty
upgrade_packs_test.go:326:
Error Trace: /home/runner/work/fleet/fleet/cmd/fleetctl/upgrade_packs_test.go:326
Error: Received unexpected error:
open testdata/expectedUpgradePacks.yml: no such file or directory
Test: TestFleetctlUpgradePacks_NonEmpty
--- FAIL: TestFleetctlUpgradePacks_NonEmpty (0.32s)
Of course the file is in this PR/branch/commit. This reads the content the same way that we do in e.g. get_test.go or apply_test.go. I'm at a loss, I will move the expected content as a string in the test, but if anyone has any idea (I did check file permissions and it is the same as the other testdata files AFAICS).
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #13078 +/- ##
==========================================
+ Coverage 58.88% 59.02% +0.13%
==========================================
Files 867 867
Lines 71296 71356 +60
Branches 1850 1802 -48
==========================================
+ Hits 41986 42121 +135
+ Misses 25891 25809 -82
- Partials 3419 3426 +7
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
| @@ -0,0 +1,434 @@ | |||
| package main | |||
| Packs are a function of osquery that provide a portable format to import /export queries in and out of platforms like Fleet. These osquery packs still exist, but have been removed from the Fleet UI. Access via API is still available for backwards compatibility. | ||
| Within Fleet we've introduced the concept of teams in Fleet premium to target specific groups of hosts, but you can also still use scheduled queries in Fleet free (works like packs) to target all your hosts. | ||
|
|
||
| The `fleetctl upgrade-packs` command can be used to convert existing packs to queries. |
There was a problem hiding this comment.
Seeing this in context, I'm realizing we probably need to update the "Where did Packs go?" answer to be more aligned with the "Why this way?" section about packs. That said, this change totally fits with the existing content, so I don't want to let that hold up this PR— just saying this as an FYI.
cc @zhumo not sure how we track inconsistencies in the docs right now so just filed it as a bug; happy to take that one on after this PR is merged.
There was a problem hiding this comment.
I think that's a good approach Rachael, please go ahead.
rachaelshaw
left a comment
There was a problem hiding this comment.
1 note about the docs as an FYI, but no need for it hold up this PR ✅
|
The 2 failing CI checks are known to fail consistently those last few days, unrelated to this specific PR. Merging. |
#12656
Checklist for submitter
If some of the following don't apply, delete the relevant line.
changes/ororbit/changes/.See Changes files for more information.
SELECT *is avoided, SQL injection is prevented (using placeholders for values in statements)