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

Update imports to elastic-agent-libs/file where needed #31419

Merged
merged 18 commits into from
Apr 29, 2022
Prev Previous commit
Next Next commit
more
  • Loading branch information
kvch committed Apr 28, 2022
commit c0a72a799a2a2b8996720ff131c0f696cd16b96d
6 changes: 3 additions & 3 deletions libbeat/cmd/instance/beat.go
Original file line number Diff line number Diff line change
Expand Up @@ -853,12 +853,12 @@ func (b *Beat) loadDashboards(ctx context.Context, force bool) error {

indexPattern, err := kibana.NewGenerator(b.Info.IndexPrefix, b.Info.Beat, b.Fields, b.Info.Version, v, b.Config.Migration.Enabled())
if err != nil {
return fmt.Errorf("error creating index pattern generator: %v", err)
return fmt.Errorf("error creating index pattern generator: %w", err)
}

pattern, err := indexPattern.Generate()
if err != nil {
return fmt.Errorf("error generating index pattern: %v", err)
return fmt.Errorf("error generating index pattern: %w", err)
}

err = dashboards.ImportDashboards(ctx, b.Info, paths.Resolve(paths.Home, ""),
Expand Down Expand Up @@ -887,7 +887,7 @@ func (b *Beat) checkElasticsearchVersion() {
return err
}
if esVersion.LessThanMajorMinor(beatVersion) {
return fmt.Errorf("%v ES=%s, Beat=%s.", elasticsearch.ErrTooOld, esVersion.String(), b.Info.Version)
return fmt.Errorf("%w ES=%s, Beat=%s.", elasticsearch.ErrTooOld, esVersion.String(), b.Info.Version)
}
return nil
})
Expand Down
2 changes: 1 addition & 1 deletion x-pack/dockerlogbeat/pipelinemanager/libbeattools.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ func loadMeta(metaPath string) (uuid.UUID, error) {
//return the UUID if it exists
if err == nil {
m := meta{}
if err := json.NewDecoder(f).Decode(&m); err != nil && err != io.EOF {
if err := json.NewDecoder(f).Decode(&m); err != nil && err != io.EOF { //nolint:errorlint // keep old behaviour
f.Close()
return uuid.Nil, fmt.Errorf("error reading %s: %w", metaPath, err)
}
Expand Down