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

packetbeat/module: fix upload of bundled ingest pipelines on Windows #41110

Merged
merged 1 commit into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ https://github.com/elastic/beats/compare/v8.8.1\...main[Check the HEAD diff]

*Packetbeat*

- Fix upload of bundled ingest pipelines on Windows. {pull}41110[41110]

*Winlogbeat*

Expand Down
6 changes: 4 additions & 2 deletions packetbeat/module/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
"encoding/json"
"errors"
"fmt"
"os"
"path"
"path/filepath"
"strings"
Expand Down Expand Up @@ -113,7 +112,10 @@
if err != nil {
return pipeline{}, err
}
ds, _, _ := strings.Cut(filename, string(os.PathSeparator))
ds, _, ok := strings.Cut(filename, "/")
if !ok {
return pipeline{}, fmt.Errorf("unexpected filename '%s': missing '/' between data stream and 'ingest'", filename)
}
p = pipeline{
id: fileset.FormatPipelineID(info.IndexPrefix, "", "", ds, info.Version),
contents: updatedContent,
Expand Down Expand Up @@ -180,7 +182,7 @@
if err != nil {
return nil, fmt.Errorf("failed to sanitize the YAML pipeline file: %s: %w", filename, err)
}
content = newContent.(map[string]interface{})

Check failure on line 185 in packetbeat/module/pipeline.go

View workflow job for this annotation

GitHub Actions / lint (windows)

Error return value is not checked (errcheck)
default:
return nil, fmt.Errorf("unsupported extension '%s' for pipeline file: %s", extension, filename)
}
Expand Down
Loading