Skip to content
Open
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
7 changes: 7 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,13 @@ linters:
- common-false-positives
- legacy
- std-error-handling
rules:
# go-elasticsearch v9 keeps the legacy Config/NewClient API fully
# functional. Fleet Server still relies on that API while the option-based
# client configuration is migrated separately.
- linters:
- staticcheck
text: "SA1019: elasticsearch\\.(Config|NewClient) is deprecated"
# Which file paths to exclude: they will be analyzed, but issues from them won't be reported.
# "/" will be replaced by the current OS file path separator to properly work on Windows.
# Default: []
Expand Down
6 changes: 3 additions & 3 deletions NOTICE-fips.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1082,12 +1082,12 @@ Contents of probable licence file $GOMODCACHE/github.com/elastic/elastic-agent-s


--------------------------------------------------------------------------------
Dependency : github.com/elastic/go-elasticsearch/v8
Version: v8.19.6
Dependency : github.com/elastic/go-elasticsearch/v9
Version: v9.5.0
Licence type (autodetected): Apache-2.0
--------------------------------------------------------------------------------

Contents of probable licence file $GOMODCACHE/github.com/elastic/go-elasticsearch/v8@v8.19.6/LICENSE:
Contents of probable licence file $GOMODCACHE/github.com/elastic/go-elasticsearch/v9@v9.5.0/LICENSE:

Apache License
Version 2.0, January 2004
Expand Down
6 changes: 3 additions & 3 deletions NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1082,12 +1082,12 @@ Contents of probable licence file $GOMODCACHE/github.com/elastic/elastic-agent-s


--------------------------------------------------------------------------------
Dependency : github.com/elastic/go-elasticsearch/v8
Version: v8.19.6
Dependency : github.com/elastic/go-elasticsearch/v9
Version: v9.5.0
Licence type (autodetected): Apache-2.0
--------------------------------------------------------------------------------

Contents of probable licence file $GOMODCACHE/github.com/elastic/go-elasticsearch/v8@v8.19.6/LICENSE:
Contents of probable licence file $GOMODCACHE/github.com/elastic/go-elasticsearch/v9@v9.5.0/LICENSE:

Apache License
Version 2.0, January 2004
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require (
github.com/elastic/elastic-agent-client/v7 v7.18.1
github.com/elastic/elastic-agent-libs v0.46.2
github.com/elastic/elastic-agent-system-metrics v0.14.4
github.com/elastic/go-elasticsearch/v8 v8.19.6
github.com/elastic/go-elasticsearch/v9 v9.5.0
github.com/elastic/go-ucfg v0.9.1
github.com/fxamacker/cbor/v2 v2.9.2
github.com/go-chi/chi/v5 v5.3.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ github.com/elastic/elastic-agent-system-metrics v0.14.4 h1:XGGepNVOxhtfJmanQsgqC
github.com/elastic/elastic-agent-system-metrics v0.14.4/go.mod h1:NyNMrdqMfznb/Zy8EmIAHlJpX6HuRlNW+bBL9UN7WQY=
github.com/elastic/elastic-transport-go/v8 v8.9.0 h1:KeT/2P54F0xS0S8Y3Pf+tFDg4HmBgReQMB+BMz8dDAs=
github.com/elastic/elastic-transport-go/v8 v8.9.0/go.mod h1:ssMTvNS2hwf7CaiGsRRsx4gQHFZ/jS/DkLcISxekWzc=
github.com/elastic/go-elasticsearch/v8 v8.19.6 h1:4qa7ecJkr5rLsoHKIVGbaqcFt2o57CnOHQJi9Pts/rk=
github.com/elastic/go-elasticsearch/v8 v8.19.6/go.mod h1:jeWebApE1oFEW/hKZqx/IRYmP/aa2+WMJkOfk+AduSI=
github.com/elastic/go-elasticsearch/v9 v9.5.0 h1:ye9pnajcrSE2Fra0Q++nJsi09p2dJTaN6YXKz7LL7WU=
github.com/elastic/go-elasticsearch/v9 v9.5.0/go.mod h1:EbZnYlTlbhNqRt98YW+QSM2SEKplN5o8J+G6d9STOVo=
github.com/elastic/go-structform v0.0.12 h1:HXpzlAKyej8T7LobqKDThUw7BMhwV6Db24VwxNtgxCs=
github.com/elastic/go-structform v0.0.12/go.mod h1:CZWf9aIRYY5SuKSmOhtXScE5uQiLZNqAFnwKR4OrIM4=
github.com/elastic/go-sysinfo v1.15.1 h1:zBmTnFEXxIQ3iwcQuk7MzaUotmKRp3OabbbWM8TdzIQ=
Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/api/handleFileDelivery.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"github.com/elastic/fleet-server/v7/internal/pkg/file"
"github.com/elastic/fleet-server/v7/internal/pkg/file/delivery"
"github.com/elastic/fleet-server/v7/internal/pkg/model"
"github.com/elastic/go-elasticsearch/v8"
"github.com/elastic/go-elasticsearch/v9"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/api/handleUpload.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
"github.com/elastic/fleet-server/v7/internal/pkg/file/cbor"
"github.com/elastic/fleet-server/v7/internal/pkg/file/uploader"
"github.com/elastic/fleet-server/v7/internal/pkg/model"
"github.com/elastic/go-elasticsearch/v8"
"github.com/elastic/go-elasticsearch/v9"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/api/handleUpload_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (
"github.com/elastic/fleet-server/v7/internal/pkg/file/uploader"
"github.com/elastic/fleet-server/v7/internal/pkg/model"
itesting "github.com/elastic/fleet-server/v7/internal/pkg/testing"
"github.com/elastic/go-elasticsearch/v8"
"github.com/elastic/go-elasticsearch/v9"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
Expand Down
4 changes: 2 additions & 2 deletions internal/pkg/apikey/apikey.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import (
"strings"
"unicode/utf8"

"github.com/elastic/go-elasticsearch/v8"
"github.com/elastic/go-elasticsearch/v8/esapi"
"github.com/elastic/go-elasticsearch/v9"
"github.com/elastic/go-elasticsearch/v9/esapi"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/apikey/apikey_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

testlog "github.com/elastic/fleet-server/v7/internal/pkg/testing/log"

"github.com/elastic/go-elasticsearch/v8"
"github.com/elastic/go-elasticsearch/v9"
"github.com/gofrs/uuid/v5"
"github.com/google/go-cmp/cmp"
)
Expand Down
4 changes: 2 additions & 2 deletions internal/pkg/apikey/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
"fmt"
"net/http"

"github.com/elastic/go-elasticsearch/v8"
"github.com/elastic/go-elasticsearch/v8/esapi"
"github.com/elastic/go-elasticsearch/v9"
"github.com/elastic/go-elasticsearch/v9/esapi"

"github.com/elastic/fleet-server/v7/internal/pkg/es"
)
Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/apikey/auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"testing"

"github.com/elastic/fleet-server/v7/internal/pkg/testing/esutil"
"github.com/elastic/go-elasticsearch/v8"
"github.com/elastic/go-elasticsearch/v9"
"github.com/stretchr/testify/assert"
)

Expand Down
4 changes: 2 additions & 2 deletions internal/pkg/apikey/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
"encoding/json"
"fmt"

"github.com/elastic/go-elasticsearch/v8"
"github.com/elastic/go-elasticsearch/v8/esapi"
"github.com/elastic/go-elasticsearch/v9"
"github.com/elastic/go-elasticsearch/v9/esapi"

"github.com/elastic/fleet-server/v7/internal/pkg/es"
)
Expand Down
4 changes: 2 additions & 2 deletions internal/pkg/apikey/invalidate.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
"encoding/json"
"fmt"

"github.com/elastic/go-elasticsearch/v8"
"github.com/elastic/go-elasticsearch/v8/esapi"
"github.com/elastic/go-elasticsearch/v9"
"github.com/elastic/go-elasticsearch/v9/esapi"

"github.com/elastic/fleet-server/v7/internal/pkg/es"
)
Expand Down
4 changes: 2 additions & 2 deletions internal/pkg/bulk/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ import (
"go.elastic.co/apm/v2"
"golang.org/x/sync/semaphore"

"github.com/elastic/go-elasticsearch/v8"
"github.com/elastic/go-elasticsearch/v8/esapi"
"github.com/elastic/go-elasticsearch/v9"
"github.com/elastic/go-elasticsearch/v9/esapi"
)

type APIKey = apikey.APIKey
Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/bulk/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"io"

"github.com/elastic/fleet-server/v7/internal/pkg/es"
"github.com/elastic/go-elasticsearch/v8/esapi"
"github.com/elastic/go-elasticsearch/v9/esapi"
"github.com/rs/zerolog"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/bulk/opApiKey.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"math"

"github.com/elastic/fleet-server/v7/internal/pkg/apikey"
"github.com/elastic/go-elasticsearch/v8/esapi"
"github.com/elastic/go-elasticsearch/v9/esapi"
"github.com/rs/zerolog"
"go.elastic.co/apm/v2"
)
Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/bulk/opBulk.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"fmt"
"time"

"github.com/elastic/go-elasticsearch/v8/esapi"
"github.com/elastic/go-elasticsearch/v9/esapi"
"github.com/mailru/easyjson"
"github.com/rs/zerolog"
"go.elastic.co/apm/v2"
Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/bulk/opRead.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"fmt"
"time"

"github.com/elastic/go-elasticsearch/v8/esapi"
"github.com/elastic/go-elasticsearch/v9/esapi"
"github.com/mailru/easyjson"
"github.com/rs/zerolog"
"go.elastic.co/apm/v2"
Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/bulk/opSearch.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (

"github.com/elastic/fleet-server/v7/internal/pkg/es"
"github.com/elastic/fleet-server/v7/internal/pkg/sqn"
"github.com/elastic/go-elasticsearch/v8/esapi"
"github.com/elastic/go-elasticsearch/v9/esapi"
"github.com/mailru/easyjson"
"github.com/rs/zerolog"
"go.elastic.co/apm/v2"
Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/bulk/secret.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"io"
"net/http"

"github.com/elastic/go-elasticsearch/v8"
"github.com/elastic/go-elasticsearch/v9"
"go.elastic.co/apm/v2"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/bulk/secret_limit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"testing"
"time"

"github.com/elastic/go-elasticsearch/v8"
"github.com/elastic/go-elasticsearch/v9"
"github.com/stretchr/testify/require"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/bulk/secret_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"strings"
"testing"

"github.com/elastic/go-elasticsearch/v8"
"github.com/elastic/go-elasticsearch/v9"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/bulk/setup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"time"

"github.com/Pallinder/go-randomdata"
"github.com/elastic/go-elasticsearch/v8"
"github.com/elastic/go-elasticsearch/v9"
"github.com/elastic/go-ucfg/yaml"
"github.com/rs/xid"

Expand Down
4 changes: 2 additions & 2 deletions internal/pkg/checkin/bulk.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (

"github.com/rs/zerolog"

estypes "github.com/elastic/go-elasticsearch/v8/typedapi/types"
"github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/scriptlanguage"
estypes "github.com/elastic/go-elasticsearch/v9/typedapi/types"
"github.com/elastic/go-elasticsearch/v9/typedapi/types/enums/scriptlanguage"
)

const defaultFlushInterval = 10 * time.Second
Expand Down
6 changes: 3 additions & 3 deletions internal/pkg/config/output.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"github.com/elastic/elastic-agent-libs/transport/tlscommon"
"github.com/elastic/fleet-server/v7/internal/pkg/logger/zap"

"github.com/elastic/go-elasticsearch/v8"
"github.com/elastic/go-elasticsearch/v9"
"github.com/rs/zerolog"
)

Expand Down Expand Up @@ -261,13 +261,13 @@ func (c *Elasticsearch) DiagRequests(ctx context.Context) []byte {
hostURL, err := makeURL(c.Protocol, "", host, 9200)
if err != nil {
zerolog.Ctx(ctx).Warn().Err(err).Str("host", host).Msg("Unable to transform host to url.URL")
res.WriteString(fmt.Sprintf("Unable to transform host %q to url.URL: %v\n", host, err))
fmt.Fprintf(&res, "Unable to transform host %q to url.URL: %v\n", host, err)
continue
}
req, err := http.NewRequestWithContext(ctx, http.MethodGet, hostURL, nil)
if err != nil {
zerolog.Ctx(ctx).Warn().Err(err).Str("host", host).Msg("Unable to create request to host")
res.WriteString(fmt.Sprintf("Unable to create request to host %q: %v\n", host, err))
fmt.Fprintf(&res, "Unable to create request to host %q: %v\n", host, err)
continue
}
req.Header = headers.Clone()
Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/config/output_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/elastic/go-elasticsearch/v8"
"github.com/elastic/go-elasticsearch/v9"

"github.com/elastic/elastic-agent-libs/transport/tlscommon"
)
Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/dl/migration.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"net/http"
"time"

"github.com/elastic/go-elasticsearch/v8/esapi"
"github.com/elastic/go-elasticsearch/v9/esapi"
"github.com/rs/zerolog"

"github.com/elastic/fleet-server/v7/internal/pkg/bulk"
Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/es/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"github.com/rs/zerolog"

backoff "github.com/cenkalti/backoff/v7"
"github.com/elastic/go-elasticsearch/v8"
"github.com/elastic/go-elasticsearch/v9"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/es/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"github.com/elastic/fleet-server/v7/internal/pkg/testing/certs"
"github.com/stretchr/testify/require"

"github.com/elastic/go-elasticsearch/v8"
"github.com/elastic/go-elasticsearch/v9"
)

var enabled bool = true
Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/es/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"context"
"encoding/json"

"github.com/elastic/go-elasticsearch/v8"
"github.com/elastic/go-elasticsearch/v9"
)

func DeleteIndices(ctx context.Context, es *elasticsearch.Client, indices []string) error {
Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/es/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"encoding/json"
"strings"

"github.com/elastic/go-elasticsearch/v8"
"github.com/elastic/go-elasticsearch/v9"
)

type versionInfo struct {
Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/file/delivery/delivery.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"github.com/elastic/fleet-server/v7/internal/pkg/bulk"
"github.com/elastic/fleet-server/v7/internal/pkg/file"
"github.com/elastic/fleet-server/v7/internal/pkg/file/cbor"
"github.com/elastic/go-elasticsearch/v8"
"github.com/elastic/go-elasticsearch/v9"
"github.com/rs/zerolog"
"go.elastic.co/apm/v2"
)
Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/file/delivery/delivery_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"github.com/elastic/fleet-server/v7/internal/pkg/es"
"github.com/elastic/fleet-server/v7/internal/pkg/file"
itesting "github.com/elastic/fleet-server/v7/internal/pkg/testing"
"github.com/elastic/go-elasticsearch/v8"
"github.com/elastic/go-elasticsearch/v9"
"github.com/rs/zerolog"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
Expand Down
4 changes: 2 additions & 2 deletions internal/pkg/file/delivery/es.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import (
"github.com/elastic/fleet-server/v7/internal/pkg/dsl"
"github.com/elastic/fleet-server/v7/internal/pkg/es"
"github.com/elastic/fleet-server/v7/internal/pkg/file"
"github.com/elastic/go-elasticsearch/v8"
"github.com/elastic/go-elasticsearch/v8/esapi"
"github.com/elastic/go-elasticsearch/v9"
"github.com/elastic/go-elasticsearch/v9/esapi"
"go.elastic.co/apm/v2"
)

Expand Down
4 changes: 2 additions & 2 deletions internal/pkg/file/uploader/es.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import (
"github.com/elastic/fleet-server/v7/internal/pkg/es"
"github.com/elastic/fleet-server/v7/internal/pkg/file"
"github.com/elastic/fleet-server/v7/internal/pkg/file/cbor"
"github.com/elastic/go-elasticsearch/v8"
"github.com/elastic/go-elasticsearch/v8/esapi"
"github.com/elastic/go-elasticsearch/v9"
"github.com/elastic/go-elasticsearch/v9/esapi"
"github.com/rs/zerolog"
"go.elastic.co/apm/v2"
)
Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/file/uploader/upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"github.com/elastic/fleet-server/v7/internal/pkg/bulk"
"github.com/elastic/fleet-server/v7/internal/pkg/cache"
"github.com/elastic/fleet-server/v7/internal/pkg/file"
"github.com/elastic/go-elasticsearch/v8"
"github.com/elastic/go-elasticsearch/v9"
"github.com/gofrs/uuid/v5"
"go.elastic.co/apm/v2"
)
Expand Down
4 changes: 2 additions & 2 deletions internal/pkg/gcheckpt/checkpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import (
esh "github.com/elastic/fleet-server/v7/internal/pkg/es"
"github.com/elastic/fleet-server/v7/internal/pkg/sqn"

"github.com/elastic/go-elasticsearch/v8"
"github.com/elastic/go-elasticsearch/v8/esapi"
"github.com/elastic/go-elasticsearch/v9"
"github.com/elastic/go-elasticsearch/v9/esapi"
)

var ErrGlobalCheckpoint = errors.New("global checkpoint error")
Expand Down
Loading
Loading