Skip to content

Commit c525aca

Browse files
authored
Merge branch 'main' into feat/standard-cache
2 parents 5927d9e + f474694 commit c525aca

File tree

21 files changed

+1632
-111
lines changed

21 files changed

+1632
-111
lines changed

.github/workflows/functional-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
export TF_VAR_CREATED_DATE=$(date +%s)
6060
VERSION="${{ matrix.active-version }}"
6161
VERSION="${VERSION//./_}"
62-
go test -run="_to_${VERSION}" -v -timeout=30m -cleanup-on-failure=false -target="${{ matrix.environment }}" ./
62+
go test -run="_to_${VERSION}" -v -timeout=30m -target="${{ matrix.environment }}" ./
6363
6464
# notify:
6565
# if: always()

Makefile

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,17 @@ LDFLAGS := \
5353
.PHONY: $(APM_SERVER_FIPS_BINARIES)
5454
$(APM_SERVER_FIPS_BINARIES):
5555
docker run --privileged --rm "tonistiigi/binfmt:latest@sha256:1b804311fe87047a4c96d38b4b3ef6f62fca8cd125265917a9e3dc3c996c39e6" --install arm64,amd64
56-
# rely on Dockerfile.fips to use the go fips toolchain
57-
docker buildx build --platform "$(GOOS)/$(GOARCH)" --build-arg GOLANG_VERSION="$(shell go list -m -f '{{.Version}}' go)" -f ./packaging/docker/Dockerfile.fips -t apm-server-fips-image-temp .
5856
# remove any leftover container from a failed task
59-
docker rm apm-server-fips-cont || true
60-
docker create --name apm-server-fips-cont apm-server-fips-image-temp
57+
docker container rm apm-server-fips-cont || true
58+
docker image rm apm-server-fips-image-temp || true
59+
# rely on Dockerfile.fips to use the go fips toolchain
60+
docker buildx build --load --platform "$(GOOS)/$(GOARCH)" --build-arg GOLANG_VERSION="$(shell go list -m -f '{{.Version}}' go)" -f ./packaging/docker/Dockerfile.fips -t apm-server-fips-image-temp .
61+
docker container create --name apm-server-fips-cont apm-server-fips-image-temp
6162
mkdir -p build
62-
docker cp apm-server-fips-cont:/usr/share/apm-server/apm-server-fips "build/apm-server-fips-$(GOOS)-$(GOARCH)"
63+
docker cp apm-server-fips-cont:/usr/share/apm-server/apm-server "build/apm-server-fips-$(GOOS)-$(GOARCH)"
6364
# cleanup running container
64-
docker rm apm-server-fips-cont
65+
docker container rm apm-server-fips-cont
66+
docker image rm apm-server-fips-image-temp
6567

6668
# Rule to build apm-server binaries, using Go's native cross-compilation.
6769
#
@@ -79,7 +81,7 @@ $(APM_SERVER_BINARIES):
7981
.PHONY: apm-server-build
8082
apm-server-build:
8183
env CGO_ENABLED=$(CGO_ENABLED) GOOS=$(GOOS) GOARCH=$(GOARCH) \
82-
go build -o "build/apm-server-$(GOOS)-$(GOARCH)$(SUFFIX)$(EXTENSION)" -trimpath $(GOFLAGS) $(GOTAGS) $(GOMODFLAG) -ldflags "$(LDFLAGS)" $(PKG)
84+
go build -o "build/apm-server-$(GOOS)-$(GOARCH)$(SUFFIX)$(EXTENSION)" -trimpath $(GOFLAGS) -tags=grpcnotrace,$(GOTAGS) $(GOMODFLAG) -ldflags "$(LDFLAGS)" $(PKG)
8385

8486
build/apm-server-linux-% build/apm-server-fips-linux-%: GOOS=linux
8587
build/apm-server-darwin-%: GOOS=darwin
@@ -108,7 +110,7 @@ apm-server apm-server-fips: PKG=./x-pack/apm-server
108110
apm-server-fips: CGO_ENABLED=1
109111
apm-server apm-server-oss: CGO_ENABLED=0
110112

111-
apm-server-fips: GOTAGS=-tags=requirefips
113+
apm-server-fips: GOTAGS=requirefips
112114

113115
apm-server-oss: SUFFIX=-oss
114116
apm-server-fips: SUFFIX=-fips

NOTICE-fips.txt

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1555,11 +1555,11 @@ Contents of probable licence file $GOMODCACHE/github.com/elastic/gmux@v0.3.2/LIC
15551555

15561556
--------------------------------------------------------------------------------
15571557
Dependency : github.com/elastic/go-docappender/v2
1558-
Version: v2.7.0
1558+
Version: v2.8.0
15591559
Licence type (autodetected): Apache-2.0
15601560
--------------------------------------------------------------------------------
15611561

1562-
Contents of probable licence file $GOMODCACHE/github.com/elastic/go-docappender/v2@v2.7.0/LICENSE:
1562+
Contents of probable licence file $GOMODCACHE/github.com/elastic/go-docappender/v2@v2.8.0/LICENSE:
15631563

15641564
Apache License
15651565
Version 2.0, January 2004
@@ -5160,11 +5160,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
51605160

51615161
--------------------------------------------------------------------------------
51625162
Dependency : golang.org/x/sync
5163-
Version: v0.12.0
5163+
Version: v0.13.0
51645164
Licence type (autodetected): BSD-3-Clause
51655165
--------------------------------------------------------------------------------
51665166

5167-
Contents of probable licence file $GOMODCACHE/golang.org/x/sync@v0.12.0/LICENSE:
5167+
Contents of probable licence file $GOMODCACHE/golang.org/x/sync@v0.13.0/LICENSE:
51685168

51695169
Copyright 2009 The Go Authors.
51705170

@@ -5197,11 +5197,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
51975197

51985198
--------------------------------------------------------------------------------
51995199
Dependency : golang.org/x/term
5200-
Version: v0.30.0
5200+
Version: v0.31.0
52015201
Licence type (autodetected): BSD-3-Clause
52025202
--------------------------------------------------------------------------------
52035203

5204-
Contents of probable licence file $GOMODCACHE/golang.org/x/term@v0.30.0/LICENSE:
5204+
Contents of probable licence file $GOMODCACHE/golang.org/x/term@v0.31.0/LICENSE:
52055205

52065206
Copyright 2009 The Go Authors.
52075207

@@ -5271,11 +5271,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
52715271

52725272
--------------------------------------------------------------------------------
52735273
Dependency : google.golang.org/grpc
5274-
Version: v1.71.0
5274+
Version: v1.71.1
52755275
Licence type (autodetected): Apache-2.0
52765276
--------------------------------------------------------------------------------
52775277

5278-
Contents of probable licence file $GOMODCACHE/google.golang.org/grpc@v1.71.0/LICENSE:
5278+
Contents of probable licence file $GOMODCACHE/google.golang.org/grpc@v1.71.1/LICENSE:
52795279

52805280

52815281
Apache License
@@ -11185,11 +11185,11 @@ Contents of probable licence file $GOMODCACHE/github.com/modern-go/concurrent@v0
1118511185

1118611186
--------------------------------------------------------------------------------
1118711187
Dependency : github.com/modern-go/reflect2
11188-
Version: v1.0.2
11188+
Version: v1.0.3-0.20250322232337-35a7c28c31ee
1118911189
Licence type (autodetected): Apache-2.0
1119011190
--------------------------------------------------------------------------------
1119111191

11192-
Contents of probable licence file $GOMODCACHE/github.com/modern-go/reflect2@v1.0.2/LICENSE:
11192+
Contents of probable licence file $GOMODCACHE/github.com/modern-go/reflect2@v1.0.3-0.20250322232337-35a7c28c31ee/LICENSE:
1119311193

1119411194
Apache License
1119511195
Version 2.0, January 2004
@@ -14369,11 +14369,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1436914369

1437014370
--------------------------------------------------------------------------------
1437114371
Dependency : golang.org/x/sys
14372-
Version: v0.31.0
14372+
Version: v0.32.0
1437314373
Licence type (autodetected): BSD-3-Clause
1437414374
--------------------------------------------------------------------------------
1437514375

14376-
Contents of probable licence file $GOMODCACHE/golang.org/x/sys@v0.31.0/LICENSE:
14376+
Contents of probable licence file $GOMODCACHE/golang.org/x/sys@v0.32.0/LICENSE:
1437714377

1437814378
Copyright 2009 The Go Authors.
1437914379

NOTICE.txt

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1555,11 +1555,11 @@ Contents of probable licence file $GOMODCACHE/github.com/elastic/gmux@v0.3.2/LIC
15551555

15561556
--------------------------------------------------------------------------------
15571557
Dependency : github.com/elastic/go-docappender/v2
1558-
Version: v2.7.0
1558+
Version: v2.8.0
15591559
Licence type (autodetected): Apache-2.0
15601560
--------------------------------------------------------------------------------
15611561

1562-
Contents of probable licence file $GOMODCACHE/github.com/elastic/go-docappender/v2@v2.7.0/LICENSE:
1562+
Contents of probable licence file $GOMODCACHE/github.com/elastic/go-docappender/v2@v2.8.0/LICENSE:
15631563

15641564
Apache License
15651565
Version 2.0, January 2004
@@ -5160,11 +5160,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
51605160

51615161
--------------------------------------------------------------------------------
51625162
Dependency : golang.org/x/sync
5163-
Version: v0.12.0
5163+
Version: v0.13.0
51645164
Licence type (autodetected): BSD-3-Clause
51655165
--------------------------------------------------------------------------------
51665166

5167-
Contents of probable licence file $GOMODCACHE/golang.org/x/sync@v0.12.0/LICENSE:
5167+
Contents of probable licence file $GOMODCACHE/golang.org/x/sync@v0.13.0/LICENSE:
51685168

51695169
Copyright 2009 The Go Authors.
51705170

@@ -5197,11 +5197,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
51975197

51985198
--------------------------------------------------------------------------------
51995199
Dependency : golang.org/x/term
5200-
Version: v0.30.0
5200+
Version: v0.31.0
52015201
Licence type (autodetected): BSD-3-Clause
52025202
--------------------------------------------------------------------------------
52035203

5204-
Contents of probable licence file $GOMODCACHE/golang.org/x/term@v0.30.0/LICENSE:
5204+
Contents of probable licence file $GOMODCACHE/golang.org/x/term@v0.31.0/LICENSE:
52055205

52065206
Copyright 2009 The Go Authors.
52075207

@@ -5271,11 +5271,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
52715271

52725272
--------------------------------------------------------------------------------
52735273
Dependency : google.golang.org/grpc
5274-
Version: v1.71.0
5274+
Version: v1.71.1
52755275
Licence type (autodetected): Apache-2.0
52765276
--------------------------------------------------------------------------------
52775277

5278-
Contents of probable licence file $GOMODCACHE/google.golang.org/grpc@v1.71.0/LICENSE:
5278+
Contents of probable licence file $GOMODCACHE/google.golang.org/grpc@v1.71.1/LICENSE:
52795279

52805280

52815281
Apache License
@@ -12682,11 +12682,11 @@ Contents of probable licence file $GOMODCACHE/github.com/modern-go/concurrent@v0
1268212682

1268312683
--------------------------------------------------------------------------------
1268412684
Dependency : github.com/modern-go/reflect2
12685-
Version: v1.0.2
12685+
Version: v1.0.3-0.20250322232337-35a7c28c31ee
1268612686
Licence type (autodetected): Apache-2.0
1268712687
--------------------------------------------------------------------------------
1268812688

12689-
Contents of probable licence file $GOMODCACHE/github.com/modern-go/reflect2@v1.0.2/LICENSE:
12689+
Contents of probable licence file $GOMODCACHE/github.com/modern-go/reflect2@v1.0.3-0.20250322232337-35a7c28c31ee/LICENSE:
1269012690

1269112691
Apache License
1269212692
Version 2.0, January 2004
@@ -16458,11 +16458,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1645816458

1645916459
--------------------------------------------------------------------------------
1646016460
Dependency : golang.org/x/sys
16461-
Version: v0.31.0
16461+
Version: v0.32.0
1646216462
Licence type (autodetected): BSD-3-Clause
1646316463
--------------------------------------------------------------------------------
1646416464

16465-
Contents of probable licence file $GOMODCACHE/golang.org/x/sys@v0.31.0/LICENSE:
16465+
Contents of probable licence file $GOMODCACHE/golang.org/x/sys@v0.32.0/LICENSE:
1646616466

1646716467
Copyright 2009 The Go Authors.
1646816468

docker-compose.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ x-logging: &default-logging
1010
max-size: "1g"
1111
services:
1212
elasticsearch:
13-
image: docker.elastic.co/elasticsearch/elasticsearch:9.1.0-de2e77fc-SNAPSHOT
13+
image: docker.elastic.co/elasticsearch/elasticsearch:9.1.0-e0282968-SNAPSHOT
1414
ports:
1515
- 9200:9200
1616
healthcheck:
@@ -41,7 +41,7 @@ services:
4141
logging: *default-logging
4242

4343
kibana:
44-
image: docker.elastic.co/kibana/kibana:9.1.0-de2e77fc-SNAPSHOT
44+
image: docker.elastic.co/kibana/kibana:9.1.0-e0282968-SNAPSHOT
4545
ports:
4646
- 5601:5601
4747
healthcheck:
@@ -60,7 +60,7 @@ services:
6060
logging: *default-logging
6161

6262
metricbeat:
63-
image: docker.elastic.co/beats/metricbeat:9.1.0-de2e77fc-SNAPSHOT
63+
image: docker.elastic.co/beats/metricbeat:9.1.0-e0282968-SNAPSHOT
6464
environment:
6565
ELASTICSEARCH_HOSTS: '["http://elasticsearch:9200"]'
6666
ELASTICSEARCH_USERNAME: "${KIBANA_ES_USER:-admin}"

functionaltests/internal/kbclient/client_test.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ func getHttpClient(t *testing.T) (*recorder.Recorder, *http.Client) {
108108
return rec, hc
109109
}
110110

111-
func TestClient_GetPackagePolicyByID(t *testing.T) {
111+
func newRecordedTestClient(t *testing.T) *kbclient.Client {
112112
kibanaURL := os.Getenv("KIBANA_URL")
113113
username := os.Getenv("KIBANA_USERNAME")
114114
password := os.Getenv("KIBANA_PASSWORD")
@@ -117,23 +117,23 @@ func TestClient_GetPackagePolicyByID(t *testing.T) {
117117
_, httpc := getHttpClient(t)
118118
kbc.Client = *httpc
119119

120+
return kbc
121+
}
122+
123+
func TestClient_GetPackagePolicyByID(t *testing.T) {
124+
kbc := newRecordedTestClient(t)
125+
120126
policy, err := kbc.GetPackagePolicyByID(context.Background(), "elastic-cloud-apm")
121127
require.NoError(t, err)
122128
assert.Equal(t, "Elastic APM", policy.Name)
123129
}
124130

125131
func TestClient_UpdatePackagePolicyByID(t *testing.T) {
126-
kibanaURL := os.Getenv("KIBANA_URL")
127-
username := os.Getenv("KIBANA_USERNAME")
128-
password := os.Getenv("KIBANA_PASSWORD")
129-
kbc, err := kbclient.New(kibanaURL, username, password)
130-
require.NoError(t, err)
131-
_, httpc := getHttpClient(t)
132-
kbc.Client = *httpc
132+
kbc := newRecordedTestClient(t)
133133

134134
ctx := context.Background()
135135
policyID := "elastic-cloud-apm"
136-
err = kbc.UpdatePackagePolicyByID(ctx, policyID,
136+
err := kbc.UpdatePackagePolicyByID(ctx, policyID,
137137
kbclient.PackagePolicy{
138138
Name: "Elastic APM",
139139
Description: "Hello World",

0 commit comments

Comments
 (0)