diff --git a/NOTICE-fips.txt b/NOTICE-fips.txt index 6cf7a935b29..e2fd00e84fe 100644 --- a/NOTICE-fips.txt +++ b/NOTICE-fips.txt @@ -1254,11 +1254,11 @@ SOFTWARE -------------------------------------------------------------------------------- Dependency : github.com/elastic/elastic-agent-libs -Version: v0.22.0 +Version: v0.23.1 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/elastic/elastic-agent-libs@v0.22.0/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/elastic/elastic-agent-libs@v0.23.1/LICENSE: Apache License Version 2.0, January 2004 diff --git a/NOTICE.txt b/NOTICE.txt index 0e036224066..fa4a11a646c 100644 --- a/NOTICE.txt +++ b/NOTICE.txt @@ -1254,11 +1254,11 @@ SOFTWARE -------------------------------------------------------------------------------- Dependency : github.com/elastic/elastic-agent-libs -Version: v0.22.0 +Version: v0.23.1 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/elastic/elastic-agent-libs@v0.22.0/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/elastic/elastic-agent-libs@v0.23.1/LICENSE: Apache License Version 2.0, January 2004 diff --git a/go.mod b/go.mod index b84f803bd28..e9f12706a83 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,7 @@ require ( github.com/elastic/cloud-on-k8s/v2 v2.0.0-20250327073047-b624240832ae github.com/elastic/elastic-agent-autodiscover v0.10.0 github.com/elastic/elastic-agent-client/v7 v7.17.2 - github.com/elastic/elastic-agent-libs v0.22.0 + github.com/elastic/elastic-agent-libs v0.23.1 github.com/elastic/elastic-agent-system-metrics v0.11.16 github.com/elastic/elastic-transport-go/v8 v8.7.0 github.com/elastic/go-elasticsearch/v8 v8.19.0 diff --git a/go.sum b/go.sum index e6495f2ed05..49c9ce3e4e7 100644 --- a/go.sum +++ b/go.sum @@ -495,8 +495,8 @@ github.com/elastic/elastic-agent-autodiscover v0.10.0 h1:WJ4zl9uSfk1kHmn2B/0byQB github.com/elastic/elastic-agent-autodiscover v0.10.0/go.mod h1:Nf3zh9FcJ9nTTswTwDTUAqXmvQllOrNliM6xmORSxwE= github.com/elastic/elastic-agent-client/v7 v7.17.2 h1:Cl2TeABqWZgW40t5fchGWT/sRk4MDDLWA0d8iHHOxLA= github.com/elastic/elastic-agent-client/v7 v7.17.2/go.mod h1:5irRFqp6HLqtu1S+OeY0jg8x7K6PLL+DW+PwVk1vJnk= -github.com/elastic/elastic-agent-libs v0.22.0 h1:36OSYIJ340kzNxwH8bkpSgt3fLbyAPGMj1zD6hcoSok= -github.com/elastic/elastic-agent-libs v0.22.0/go.mod h1:xSeIP3NtOIT4N2pPS4EyURmS1Q8mK0lWZ8Wd1Du6q3w= +github.com/elastic/elastic-agent-libs v0.23.1 h1:5w1fAuK7mMUpr2jZKC7OyZApfUpYEoHnWMWNpDkSDTM= +github.com/elastic/elastic-agent-libs v0.23.1/go.mod h1:xSeIP3NtOIT4N2pPS4EyURmS1Q8mK0lWZ8Wd1Du6q3w= github.com/elastic/elastic-agent-system-metrics v0.11.16 h1:cLjuO8pE5cUwPGWUHmy1VOERmJVDaep8gY+U4YRQ5vs= github.com/elastic/elastic-agent-system-metrics v0.11.16/go.mod h1:qiZC5p1hd8te4XVnhh7FkXdcYhxFnl5i9GJpROtf6zo= github.com/elastic/elastic-transport-go/v8 v8.7.0 h1:OgTneVuXP2uip4BA658Xi6Hfw+PeIOod2rY3GVMGoVE= diff --git a/internal/pkg/agent/application/actions/handlers/handler_action_policy_reassign.go b/internal/pkg/agent/application/actions/handlers/handler_action_policy_reassign.go index 156c34943da..9a40340bf73 100644 --- a/internal/pkg/agent/application/actions/handlers/handler_action_policy_reassign.go +++ b/internal/pkg/agent/application/actions/handlers/handler_action_policy_reassign.go @@ -29,9 +29,9 @@ func (h *PolicyReassign) Handle(ctx context.Context, a fleetapi.Action, acker ac h.log.Debugf("handlerPolicyReassign: action '%+v' received", a) if err := acker.Ack(ctx, a); err != nil { - h.log.Errorf("failed to acknowledge POLICY_REASSIGN action with id '%s'", a.ID) + h.log.Errorf("failed to acknowledge POLICY_REASSIGN action with id '%s'", a.ID()) } else if err := acker.Commit(ctx); err != nil { - h.log.Errorf("failed to commit acker after acknowledging action with id '%s'", a.ID) + h.log.Errorf("failed to commit acker after acknowledging action with id '%s'", a.ID()) } return nil diff --git a/internal/pkg/agent/application/upgrade/artifact/download/http/verify_backoff_rtt.go b/internal/pkg/agent/application/upgrade/artifact/download/http/verify_backoff_rtt.go index 0f90e7ae657..6805c6851e8 100644 --- a/internal/pkg/agent/application/upgrade/artifact/download/http/verify_backoff_rtt.go +++ b/internal/pkg/agent/application/upgrade/artifact/download/http/verify_backoff_rtt.go @@ -63,20 +63,20 @@ func (btr *BackoffRoundTripper) RoundTrip(req *http.Request) (*http.Response, er if resettableBody != nil { _, err = resettableBody.Seek(0, io.SeekStart) if err != nil { - btr.logger.Errorf("error while resetting request body: %w", err) + btr.logger.Errorf("error while resetting request body: %s", err.Error()) } } attempt++ resp, err = btr.next.RoundTrip(req) //nolint:bodyclose // the response body is closed when status code >= 400 or it is closed by the caller if err != nil { - btr.logger.Errorf("attempt %d: error round-trip: %w", err) + btr.logger.Errorf("attempt %d: error round-trip: %s", attempt, err.Error()) return err } if resp.StatusCode >= 400 { if err := resp.Body.Close(); err != nil { - btr.logger.Errorf("attempt %d: error closing the response body: %w", attempt, err) + btr.logger.Errorf("attempt %d: error closing the response body: %s", attempt, err.Error()) } btr.logger.Errorf("attempt %d: received response status: %d", attempt, resp.StatusCode) return errors.New(fmt.Sprintf("received response status: %d", resp.StatusCode)) diff --git a/internal/pkg/agent/application/upgrade/upgrade.go b/internal/pkg/agent/application/upgrade/upgrade.go index 19d3b67cb2b..a8eb8144759 100644 --- a/internal/pkg/agent/application/upgrade/upgrade.go +++ b/internal/pkg/agent/application/upgrade/upgrade.go @@ -269,7 +269,7 @@ func (u *Upgrader) Upgrade(ctx context.Context, version string, sourceURI string // in case of error fallback to keep-all detectedFlavor, err := install.UsedFlavor(paths.Top(), "") if err != nil { - u.log.Warnf("error encountered when detecting used flavor with top path %q: %w", paths.Top(), err) + u.log.Warnf("error encountered when detecting used flavor with top path %q: %s", paths.Top(), err.Error()) } u.log.Debugf("detected used flavor: %q", detectedFlavor) unpackRes, err := u.unpack(version, archivePath, paths.Data(), detectedFlavor) diff --git a/internal/pkg/agent/migration/migrate_config.go b/internal/pkg/agent/migration/migrate_config.go index c85122128ad..f03b9c86f2a 100644 --- a/internal/pkg/agent/migration/migrate_config.go +++ b/internal/pkg/agent/migration/migrate_config.go @@ -32,8 +32,8 @@ func MigrateToEncryptedConfig(ctx context.Context, l *logp.Logger, unencryptedCo unencStat, unencFileErr := os.Stat(unencryptedConfigPath) - l.Debugf(fmt.Sprintf("checking stat of enc config %q: %+v, err: %v", encryptedConfigPath, encStat, encFileErr)) - l.Debugf(fmt.Sprintf("checking stat of unenc config %q: %+v, err: %v", unencryptedConfigPath, unencStat, unencFileErr)) + l.Debugf("checking stat of enc config %q: %+v, err: %v", encryptedConfigPath, encStat, encFileErr) + l.Debugf("checking stat of unenc config %q: %+v, err: %v", unencryptedConfigPath, unencStat, unencFileErr) isEncryptedConfigEmpty := errors.Is(encFileErr, fs.ErrNotExist) || encStat.Size() == 0 isUnencryptedConfigPresent := unencFileErr == nil && unencStat.Size() > 0 @@ -54,7 +54,7 @@ func MigrateToEncryptedConfig(ctx context.Context, l *logp.Logger, unencryptedCo defer func() { err = reader.Close() if err != nil { - l.Errorf(fmt.Sprintf("Error closing unencrypted store reader for %q: %v", unencryptedConfigPath, err)) + l.Errorf("Error closing unencrypted store reader for %q: %v", unencryptedConfigPath, err) } }() store, err := storage.NewEncryptedDiskStore(ctx, encryptedConfigPath, storageOpts...) diff --git a/internal/pkg/composable/providers/kubernetes/kubernetes.go b/internal/pkg/composable/providers/kubernetes/kubernetes.go index 05583996920..b84ea1cd2fb 100644 --- a/internal/pkg/composable/providers/kubernetes/kubernetes.go +++ b/internal/pkg/composable/providers/kubernetes/kubernetes.go @@ -124,7 +124,7 @@ func (p *dynamicProvider) watchResource( } p.config.Node, err = kubernetes.DiscoverKubernetesNode(p.logger, nd) if err != nil { - p.logger.Debugf("Kubernetes provider skipped, unable to discover node: %w", err) + p.logger.Debugf("Kubernetes provider skipped, unable to discover node: %s", err.Error()) return nil, nil } diff --git a/internal/pkg/config/loader.go b/internal/pkg/config/loader.go index 8dd8e0b043a..efa2b58e46d 100644 --- a/internal/pkg/config/loader.go +++ b/internal/pkg/config/loader.go @@ -53,7 +53,7 @@ func (l *Loader) Load(files []string) (*Config, error) { return nil, fmt.Errorf("cannot get configuration from '%s': %w", f, err) } inputsList = append(inputsList, inp...) - l.logger.Debugf("Loaded %s input(s) from configuration from %s", len(inp), f) + l.logger.Debugf("Loaded %d input(s) from configuration from %s", len(inp), f) } else { if err := merger.Add(cfg.access(), err); err != nil { return nil, fmt.Errorf("failed to merge configuration file '%s' to existing one: %w", f, err) diff --git a/internal/pkg/remote/client.go b/internal/pkg/remote/client.go index 0b1b4a0b32f..cf670464472 100644 --- a/internal/pkg/remote/client.go +++ b/internal/pkg/remote/client.go @@ -221,7 +221,7 @@ func (c *Client) Send( errs = append(errs, fmt.Errorf("%s: %w", msg, err)) // Using debug level as the error is only relevant if all clients fail. - c.log.With("error", err).Debugf(msg) + c.log.With("error", err).Debug(msg) continue } c.checkApiVersionHeaders(req, resp) diff --git a/pkg/testing/ess/serverless_provisioner.go b/pkg/testing/ess/serverless_provisioner.go index 724c49252b5..2b0701a968e 100644 --- a/pkg/testing/ess/serverless_provisioner.go +++ b/pkg/testing/ess/serverless_provisioner.go @@ -34,7 +34,7 @@ func (log *defaultLogger) Logf(format string, args ...any) { if len(args) == 0 { } else { - log.wrapped.Infof(format, args) + log.wrapped.Infof(format, args...) } }