Skip to content

Commit 468983a

Browse files
authored
feat: add journalctl logs to support-bundle (runfinch#1630)
Signed-off-by: David Son <davbson@amazon.com>
1 parent 7c684d1 commit 468983a

14 files changed

+418
-260
lines changed

cmd/finch/main_native_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ func TestXmain(t *testing.T) {
8888
}
8989

9090
for _, tc := range testCases {
91-
tc := tc
9291
t.Run(tc.name, func(t *testing.T) {
9392
t.Parallel()
9493

cmd/finch/nerdctl_native_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ func TestNerdctlCommand_runAdaptor(t *testing.T) {
4343
}
4444

4545
for _, tc := range testCases {
46-
tc := tc
4746
t.Run(tc.name, func(t *testing.T) {
4847
t.Parallel()
4948

@@ -160,7 +159,6 @@ func TestNerdctlCommand_run(t *testing.T) {
160159
}
161160

162161
for _, tc := range testCases {
163-
tc := tc
164162
t.Run(tc.name, func(t *testing.T) {
165163
t.Parallel()
166164

cmd/finch/support_bundle.go

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,19 @@ func newSupportBundleGenerateCommand(logger flog.Logger, builder support.BundleB
3333
RunE: newGenerateSupportBundleAction(logger, builder, ncc).runAdapter,
3434
}
3535

36-
includeUsage := "additional files to include in the support bundle, specified by absolute or relative path."
36+
includeUsage := `additional files to include in the support bundle, specified by absolute or relative path.` +
37+
`To include journal logs for a service, prefix the file path with "service:".`
3738
if runtime.GOOS != "linux" {
38-
includeUsage += `To include a file from the VM, prefix the file path with "vm:"`
39+
includeUsage += ` To include a file from the VM, prefix the file path with "vm:"`
3940
}
41+
excludeUsage := `files to exclude from the support bundle. ` +
42+
`If you specify a base name, all files matching that base name will be excluded. ` +
43+
`If you specify an absolute or relative path, only exact matches will be excluded.` +
44+
`To exclude journal logs for a service, prefix the file path with "service":".` +
45+
`To exclude all journal logs, use "service:all"`
4046

4147
supportBundleGenerateCommand.Flags().StringArray("include", []string{}, includeUsage)
42-
supportBundleGenerateCommand.Flags().StringArray("exclude", []string{},
43-
//nolint:lll // usage string
44-
"files to exclude from the support bundle. if you specify a base name, all files matching that base name will be excluded. if you specify an absolute or relative path, only exact matches will be excluded")
48+
supportBundleGenerateCommand.Flags().StringArray("exclude", []string{}, excludeUsage)
4549
return supportBundleGenerateCommand
4650
}
4751

cmd/finch/version_native_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ func TestVersionAction_runAdaptor(t *testing.T) {
115115
}
116116

117117
for _, tc := range testCases {
118-
tc := tc
119118
t.Run(tc.name, func(t *testing.T) {
120119
t.Parallel()
121120

@@ -295,7 +294,6 @@ func TestVersionAction_run(t *testing.T) {
295294
}
296295

297296
for _, tc := range testCases {
298-
tc := tc
299297
t.Run(tc.name, func(t *testing.T) {
300298
t.Parallel()
301299

docs/cmd/finch_support-bundle_generate.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Generates a collection of logs and configs that can be uploaded to a Github issu
99
## Options
1010

1111
```text
12-
--exclude stringArray files to exclude from the support bundle. if you specify a base name, all files matching that base name will be excluded. if you specify an absolute or relative path, only exact matches will be excluded
12+
--exclude stringArray files to exclude from the support bundle. If you specify a base name, all files matching that base name will be excluded. If you specify an absolute or relative path, only exact matches will be excluded. To exclude journal logs for a service, prefix the file path with "service":. To exclude all journal logs, use "service:all"
1313
-h, --help help for generate
14-
--include stringArray additional files to include in the support bundle, specified by absolute or relative path. to include a file from the VM, prefix the file path with "vm:"
14+
--include stringArray additional files to include in the support bundle, specified by absolute or relative path. To include journal logs for a service, prefix the file path with "service:". To include a file from the VM, prefix the file path with "vm:"
1515
```

0 commit comments

Comments
 (0)