Skip to content

Commit 26d050b

Browse files
add random name to service token generation
1 parent 0440df3 commit 26d050b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pkg/testing/tools/estools/elasticsearch.go

+3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ import (
1313
"strconv"
1414
"strings"
1515

16+
"github.com/google/uuid"
17+
1618
"github.com/elastic/elastic-agent-libs/mapstr"
1719
"github.com/elastic/elastic-transport-go/v8/elastictransport"
1820
"github.com/elastic/go-elasticsearch/v8/esapi"
@@ -205,6 +207,7 @@ func CreateServiceToken(ctx context.Context, client elastictransport.Interface,
205207
req := esapi.SecurityCreateServiceTokenRequest{
206208
Namespace: "elastic",
207209
Service: service,
210+
Name: uuid.New().String(), // FIXME(michel-laterman): We need to specify a random name until an upstream issue is fixed: https://github.com/elastic/go-elasticsearch/issues/861
208211
}
209212
resp, err := req.Do(ctx, client)
210213
if err != nil {

0 commit comments

Comments
 (0)