Skip to content

Commit f2ff126

Browse files
michel-latermanmergify[bot]
authored andcommittedFeb 20, 2025·
Fix docker image build for FIPS variants (#4472)
Fix multiple -tags= flags occurances. Correct the resulting docker image that's created when FIPS is used. Add fips e2e test that verifies a binary. (cherry picked from commit c83472b) # Conflicts: # Dockerfile.fips # Makefile
1 parent 6bc17a6 commit f2ff126

14 files changed

+279
-27
lines changed
 

‎.buildkite/pipeline.yml

+17
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,23 @@ steps:
115115
- build/*.xml
116116
- build/e2e-coverage.out
117117

118+
- label: "FIPS E2E Test"
119+
key: "fips-e2e-test"
120+
env:
121+
FIPS: true
122+
command: ".buildkite/scripts/e2e_test.sh"
123+
agents:
124+
provider: "gcp"
125+
artifact_paths:
126+
- build/*.xml
127+
- build/e2e-coverage.out
128+
plugins:
129+
- test-collector#v1.10.2:
130+
files: "build/test-*.xml"
131+
format: "junit"
132+
branches: "main"
133+
debug: true
134+
118135
- label: ":junit: Junit annotate"
119136
plugins:
120137
- junit-annotate#v2.4.1:

‎.github/workflows/golangci-lint.yml

+2-4
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ permissions:
1010
contents: read
1111
# Optional: allow read access to pull request. Use with `only-new-issues` option.
1212
pull-requests: read
13+
checks: write
1314
jobs:
1415
golangci:
1516
strategy:
@@ -38,7 +39,7 @@ jobs:
3839
uses: golangci/golangci-lint-action@v2
3940
with:
4041
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
41-
version: v1.61.0
42+
version: v1.64.5
4243

4344
# Give the job more time to execute.
4445
# Regarding `--whole-files`, the linter is supposed to support linting of changed a patch only but,
@@ -49,8 +50,5 @@ jobs:
4950
# into fixing all linting issues in the whole file instead.
5051
args: --timeout=30m --whole-files
5152

52-
# Optional: if set to true then the action will use pre-installed Go.
53-
skip-go-installation: true
54-
5553
# Optional: show only new issues if it's a pull request. The default value is `false`.
5654
only-new-issues: true

‎.golangci.yml

+5-6
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
run:
33
# timeout for analysis, e.g. 30s, 5m, default is 1m
44
timeout: 1m
5-
build-tags: integration
5+
build-tags:
6+
- integration
67
go: "1.23.6"
78

89
issues:
@@ -52,7 +53,6 @@ linters:
5253
- asciicheck # simple linter to check that your code does not contain non-ASCII identifiers
5354
- bodyclose # checks whether HTTP response body is closed successfully
5455
- durationcheck # check for two durations multiplied together
55-
- exportloopref # checks for pointers to enclosing loop variables
5656
- goimports # Goimports does everything that gofmt does. Additionally it checks unused imports
5757
- gosec # inspects source code for security problems
5858
- importas # enforces consistent import aliases
@@ -64,7 +64,8 @@ linters:
6464
- asasalint
6565
- bidichk
6666
- gocheckcompilerdirectives
67-
- tenv
67+
- copyloopvar
68+
- usetesting
6869

6970

7071
# all available settings of specific linters
@@ -97,7 +98,7 @@ linters-settings:
9798
forbid:
9899
- fmt.Print.* # too much log noise
99100
# Exclude godoc examples from forbidigo checks. Default is true.
100-
exclude_godoc_examples: true
101+
exclude-godoc-examples: true
101102

102103
gomoddirectives:
103104
# Allow local `replace` directives. Default is false.
@@ -119,8 +120,6 @@ linters-settings:
119120
nolintlint:
120121
# Enable to ensure that nolint directives are all used. Default is true.
121122
allow-unused: false
122-
# Disable to ensure that nolint directives don't have a leading space. Default is true.
123-
allow-leading-space: true
124123
# Exclude following linters from requiring an explanation. Default is [].
125124
allow-no-explanation: []
126125
# Enable to require an explanation of nonzero length after each nolint directive. Default is false.

‎Dockerfile.fips

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
ARG GO_VERSION
2+
FROM mcr.microsoft.com/oss/go/microsoft/golang:${GO_VERSION}-1-fips-bookworm AS base
3+
4+
ENV FIPS=true
5+
ENV CGO_ENABLED=1
6+
7+
RUN mkdir -p /.cache \
8+
&& chmod 777 /.cache
9+
10+
WORKDIR /go/src/github.com/elastic/fleet-server
11+
12+
# pre-copy/cache go.mod for pre-downloading dependencies and only redownloading them in subsequent builds if they change
13+
COPY go.mod go.sum ./
14+
RUN go mod download && go mod verify
15+
16+
ENTRYPOINT [ "make" ]
17+
CMD [ "release" ]
18+
19+
FROM base AS builder
20+
21+
COPY . .
22+
23+
ARG GCFLAGS=""
24+
ARG LDFLAGS=""
25+
ARG DEV=""
26+
ARG TARGETPLATFORM
27+
28+
RUN FIPS=true CGO_ENABLED=1 GCFLAGS="${GCFLAGS}" LDFLAGS="${LDFLAGS}" DEV="${DEV}" make release-${TARGETPLATFORM}
29+
30+
FROM docker.elastic.co/wolfi/chainguard-base-fips:latest
31+
ARG VERSION
32+
ARG TARGETOS
33+
ARG TARGETARCH
34+
35+
RUN addgroup --gid 1000 fleet-server && \
36+
adduser -H -D -u 1000 -G fleet-server fleet-server
37+
38+
USER fleet-server
39+
40+
COPY --chown=fleet-server:fleet-server --chmod=644 fleet-server.yml /etc/fleet-server.yml
41+
COPY --chown=fleet-server:fleet-server --chmod=555 --from=builder /go/src/github.com/elastic/fleet-server/build/binaries/fleet-server-${VERSION}-${TARGETOS:-linux}-*-fips/fleet-server /usr/bin/fleet-server
42+
43+
ENV GOFIPS=1
44+
45+
CMD [ "/usr/bin/fleet-server", "-c", "/etc/fleet-server.yml" ]

‎Makefile

+101-7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
# Makefile for fleet-server
2+
# Many of the targets can change behaviour based on the following flags:
3+
# - SNAPSHOT - true/false (default false); Make a SNAPSHOT build; fleet-server will allow agents on the next minor version to connect
4+
# - DEV - true/false (default false); Make a dev build, compiler inlining and optimizations are disabled and the symbols table is kept
5+
# - FIPS - true/false (default false); Make a FIPS build.
6+
#
7+
# Additionally the PLATFORMS env var can be used to deterimine outputs for specific targets, such as release.
8+
19
SHELL=/usr/bin/env bash
210
GO_VERSION=$(shell cat '.go-version')
311
DEFAULT_VERSION=$(shell awk '/const DefaultVersion/{print $$NF}' version/version.go | tr -d '"')
@@ -14,7 +22,12 @@ BUILDMODE_darwin_amd64=-buildmode=pie
1422
BUILDMODE_darwin_arm64=-buildmode=pie
1523

1624
CROSSBUILD_SUFFIX=main-debian11
25+
<<<<<<< HEAD
1726
BUILDER_IMAGE=docker.elastic.co/beats-dev/golang-crossbuild:${GO_VERSION}-${CROSSBUILD_SUFFIX}
27+
=======
28+
STANDALONE_DOCKERFILE=Dockerfile
29+
BUILDER_IMAGE=fleet-server-builder:${GO_VERSION}
30+
>>>>>>> c83472b (Fix docker image build for FIPS variants (#4472))
1831

1932
#Benchmark related targets
2033
BENCH_BASE ?= benchmark-$(COMMIT).out
@@ -35,13 +48,32 @@ ifdef VERSION_QUALIFIER
3548
DEFAULT_VERSION:=${DEFAULT_VERSION}-${VERSION_QUALIFIER}
3649
endif
3750

51+
# gobuildtags is an intermediate variable that is used to properly assemble GOBUILDTAGS, a comma seperated list of tags to use with go build
52+
gobuildtags=
3853
ifeq ($(SNAPSHOT),true)
3954
VERSION=${DEFAULT_VERSION}-SNAPSHOT
55+
gobuildtags=snapshot
4056
else
4157
VERSION=${DEFAULT_VERSION}
4258
endif
4359

60+
<<<<<<< HEAD
61+
=======
62+
DOCKER_PLATFORMS ?= linux/amd64 linux/arm64
63+
# defing the docker image tag used for stand-alone fleet-server images
64+
# only want to define the tag if none is specified, this allows an invocation like
65+
# FIPS=true make test-e2e
66+
# to use a tag like X.Y.Z-fips and not X.Y.Z-fips-fips as the test-e2e target calls into make
67+
ifndef DOCKER_IMAGE_TAG
68+
>>>>>>> c83472b (Fix docker image build for FIPS variants (#4472))
4469
DOCKER_IMAGE_TAG?=${VERSION}
70+
ifeq "${DEV}" "true"
71+
DOCKER_IMAGE_TAG:=${DOCKER_IMAGE_TAG}-dev
72+
endif
73+
ifeq "${FIPS}" "true"
74+
DOCKER_IMAGE_TAG:=${DOCKER_IMAGE_TAG}-fips
75+
endif
76+
endif
4577
DOCKER_IMAGE?=docker.elastic.co/fleet-server/fleet-server
4678

4779
PLATFORM_TARGETS=$(addprefix release-, $(PLATFORMS))
@@ -64,6 +96,32 @@ GOBIN=$(shell go env GOPATH)/bin/
6496

6597
OS_NAME:=$(shell uname -s)
6698

99+
<<<<<<< HEAD
100+
=======
101+
# Set FIPS=true to force FIPS compliance when building
102+
FIPS?=
103+
# NOTE: We are assuming that the only GOEXPIREMENT flag will be associated with FIPS
104+
GOFIPSEXPERIMENT?=
105+
FIPSSUFFIX=
106+
ifeq "${FIPS}" "true"
107+
BUILDER_IMAGE=fleet-server-fips-builder:${GO_VERSION}
108+
STANDALONE_DOCKERFILE=Dockerfile.fips
109+
PLATFORMS = linux/amd64 linux/arm64
110+
gobuildtags += requirefips
111+
GOFIPSEXPERIMENT=GOEXPERIMENT=systemcrypto
112+
FIPSSUFFIX=-fips
113+
endif
114+
115+
# Assemble GOBUILDTAGS with some Makefile trickery as we need to avoid sending multiple -tags flags
116+
# the character of a comma needs a variable so it can be used as a value in a subst call
117+
comma=,
118+
# transform the space-seperated values in gobuildtags to a comma seperated string
119+
GOBUILDTAGS=$(subst $() $(),$(comma),$(gobuildtags))
120+
121+
.EXPORT_ALL_VARIABLES:
122+
FIPS=${FIPS}
123+
124+
>>>>>>> c83472b (Fix docker image build for FIPS variants (#4472))
67125
.PHONY: help
68126
help: ## - Show help message
69127
@printf "${CMD_COLOR_ON} usage: make [target]\n\n${CMD_COLOR_OFF}"
@@ -76,7 +134,11 @@ list-platforms: ## - Show the possible PLATFORMS
76134
.PHONY: local
77135
local: ## - Build local binary for local environment (bin/fleet-server)
78136
@printf "${CMD_COLOR_ON} Build binaries using local go installation\n${CMD_COLOR_OFF}"
137+
<<<<<<< HEAD
79138
go build $(if $(SNAPSHOT),-tags="snapshot",) -gcflags="${GCFLAGS}" -ldflags="${LDFLAGS}" -o ./bin/fleet-server .
139+
=======
140+
${GOFIPSEXPERIMENT} go build -tags=${GOBUILDTAGS} -gcflags="${GCFLAGS}" -ldflags="${LDFLAGS}" -o ./bin/fleet-server .
141+
>>>>>>> c83472b (Fix docker image build for FIPS variants (#4472))
80142
@printf "${CMD_COLOR_ON} Binaries in ./bin/\n${CMD_COLOR_OFF}"
81143

82144
.PHONY: $(COVER_TARGETS)
@@ -86,7 +148,11 @@ $(COVER_TARGETS): cover-%: ## - Build a binary with the -cover flag for integrat
86148
$(eval $@_GO_ARCH := $(lastword $(subst /, ,$(lastword $(subst cover-, ,$@)))))
87149
$(eval $@_ARCH := $(TARGET_ARCH_$($@_GO_ARCH)))
88150
$(eval $@_BUILDMODE:= $(BUILDMODE_$($@_OS)_$($@_GO_ARCH)))
151+
<<<<<<< HEAD
89152
GOOS=$($@_OS) GOARCH=$($@_GO_ARCH) go build $(if $(SNAPSHOT),-tags="snapshot",) -cover -coverpkg=./... -gcflags="${GCFLAGS}" -ldflags="${LDFLAGS}" $($@_BUILDMODE) -o build/cover/fleet-server-$(VERSION)-$($@_OS)-$($@_ARCH)/fleet-server$(if $(filter windows,$($@_OS)),.exe,) .
153+
=======
154+
GOOS=$($@_OS) GOARCH=$($@_GO_ARCH) ${GOFIPSEXPERIMENT} go build -tags=${GOBUILDTAGS} -cover -coverpkg=./... -gcflags="${GCFLAGS}" -ldflags="${LDFLAGS}" $($@_BUILDMODE) -o build/cover/fleet-server-$(VERSION)-$($@_OS)-$($@_ARCH)$(FIPSSUFFIX)/fleet-server$(if $(filter windows,$($@_OS)),.exe,) .
155+
>>>>>>> c83472b (Fix docker image build for FIPS variants (#4472))
90156

91157
.PHONY: clean
92158
clean: ## - Clean up build artifacts
@@ -122,7 +188,7 @@ check-headers: ## - Check copyright headers
122188

123189
.PHONY: check-go
124190
check-go: ## - Run golangci-lint
125-
@curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/d58dbde584c801091e74a00940e11ff18c6c68bd/install.sh | sh -s v1.61.0
191+
@curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/d58dbde584c801091e74a00940e11ff18c6c68bd/install.sh | sh -s v1.64.5
126192
@./bin/golangci-lint run -v
127193

128194
.PHONY: notice
@@ -161,11 +227,19 @@ test-release: ## - Check that all release binaries are created
161227

162228
.PHONY: test-unit
163229
test-unit: prepare-test-context ## - Run unit tests only
230+
<<<<<<< HEAD
164231
set -o pipefail; go test ${GO_TEST_FLAG} -v -race -coverprofile=build/coverage-${OS_NAME}.out ./... | tee build/test-unit-${OS_NAME}.out
165232

166233
.PHONY: benchmark
167234
benchmark: prepare-test-context install-benchstat ## - Run benchmark tests only
168235
set -o pipefail; go test -bench=$(BENCHMARK_FILTER) -run=$(BENCHMARK_FILTER) $(BENCHMARK_ARGS) $(BENCHMARK_PACKAGE) | tee "build/$(BENCH_BASE)"
236+
=======
237+
set -o pipefail; go test ${GO_TEST_FLAG} -tags=$(GOBUILDTAGS) -v -race -coverprofile=build/coverage-${OS_NAME}.out ./... | tee build/test-unit-${OS_NAME}.out
238+
239+
.PHONY: benchmark
240+
benchmark: prepare-test-context install-benchstat ## - Run benchmark tests only
241+
set -o pipefail; go test -bench=$(BENCHMARK_FILTER) -tags=$(GOBUILDTAGS) -run=$(BENCHMARK_FILTER) $(BENCHMARK_ARGS) $(BENCHMARK_PACKAGE) | tee "build/$(BENCH_BASE)"
242+
>>>>>>> c83472b (Fix docker image build for FIPS variants (#4472))
169243

170244
.PHONY: install-benchstat
171245
install-benchstat: ## - Install the benchstat package
@@ -201,7 +275,11 @@ $(PLATFORM_TARGETS): release-%:
201275
$(eval $@_GO_ARCH := $(lastword $(subst /, ,$(lastword $(subst release-, ,$@)))))
202276
$(eval $@_ARCH := $(TARGET_ARCH_$($@_GO_ARCH)))
203277
$(eval $@_BUILDMODE:= $(BUILDMODE_$($@_OS)_$($@_GO_ARCH)))
278+
<<<<<<< HEAD
204279
GOOS=$($@_OS) GOARCH=$($@_GO_ARCH) go build $(if $(SNAPSHOT),-tags="snapshot",) -gcflags="${GCFLAGS}" -ldflags="${LDFLAGS}" $($@_BUILDMODE) -o build/binaries/fleet-server-$(VERSION)-$($@_OS)-$($@_ARCH)/fleet-server .
280+
=======
281+
GOOS=$($@_OS) GOARCH=$($@_GO_ARCH) ${GOFIPSEXPERIMENT} go build -tags=${GOBUILDTAGS} -gcflags="${GCFLAGS}" -ldflags="${LDFLAGS}" $($@_BUILDMODE) -o build/binaries/fleet-server-$(VERSION)-$($@_OS)-$($@_ARCH)$(FIPSSUFFIX)/fleet-server .
282+
>>>>>>> c83472b (Fix docker image build for FIPS variants (#4472))
205283
@$(MAKE) OS=$($@_OS) ARCH=$($@_ARCH) package-target
206284

207285
.PHONY: build-docker
@@ -213,7 +291,8 @@ build-docker:
213291
--build-arg=DEV="$(DEV)" \
214292
--build-arg=SNAPSHOT="$(SNAPSHOT)" \
215293
--build-arg=VERSION="$(VERSION)" \
216-
-t $(DOCKER_IMAGE):$(DOCKER_IMAGE_TAG)$(if $(DEV),-dev,) .
294+
-f $(STANDALONE_DOCKERFILE) \
295+
-t $(DOCKER_IMAGE):$(DOCKER_IMAGE_TAG) .
217296

218297
.PHONY: build-and-push-docker
219298
build-and-push-docker:
@@ -226,12 +305,12 @@ build-and-push-docker:
226305
--build-arg=DEV="$(DEV)" \
227306
--build-arg=SNAPSHOT="$(SNAPSHOT)" \
228307
--build-arg=VERSION="$(VERSION)" \
229-
-t $(DOCKER_IMAGE):$(DOCKER_IMAGE_TAG)$(if $(DEV),-dev,) .
308+
-t $(DOCKER_IMAGE):$(DOCKER_IMAGE_TAG) .
230309

231310
.PHONY: release-docker
232311
release-docker:
233312
docker push \
234-
$(DOCKER_IMAGE):$(DOCKER_IMAGE_TAG)$(if $(DEV),-dev,)
313+
$(DOCKER_IMAGE):$(DOCKER_IMAGE_TAG)
235314

236315
.PHONY: package-target
237316
package-target: build/distributions
@@ -244,8 +323,13 @@ else ifeq ($(OS)-$(ARCH),darwin-arm64)
244323
@tar -C build/binaries -zcf build/distributions/fleet-server-$(VERSION)-$(OS)-aarch64.tar.gz fleet-server-$(VERSION)-$(OS)-aarch64
245324
@cd build/distributions && shasum -a 512 fleet-server-$(VERSION)-$(OS)-aarch64.tar.gz > fleet-server-$(VERSION)-$(OS)-aarch64.tar.gz.sha512
246325
else
326+
<<<<<<< HEAD
247327
@tar -C build/binaries -zcf build/distributions/fleet-server-$(VERSION)-$(OS)-$(ARCH).tar.gz fleet-server-$(VERSION)-$(OS)-$(ARCH)
248328
@cd build/distributions && shasum -a 512 fleet-server-$(VERSION)-$(OS)-$(ARCH).tar.gz > fleet-server-$(VERSION)-$(OS)-$(ARCH).tar.gz.sha512
329+
=======
330+
@tar -C build/binaries -zcf build/distributions/fleet-server-$(VERSION)-$(OS)-$(ARCH)$(FIPSSUFFIX).tar.gz fleet-server-$(VERSION)-$(OS)-$(ARCH)$(FIPSSUFFIX)
331+
@cd build/distributions && sha512sum fleet-server-$(VERSION)-$(OS)-$(ARCH)$(FIPSSUFFIX).tar.gz > fleet-server-$(VERSION)-$(OS)-$(ARCH)$(FIPSSUFFIX).tar.gz.sha512
332+
>>>>>>> c83472b (Fix docker image build for FIPS variants (#4472))
249333
endif
250334

251335
build-releaser: ## - Build a Docker image to run make package including all build tools
@@ -262,8 +346,18 @@ docker-release: build-releaser ## - Builds a release for all platforms in a dock
262346

263347
.PHONY: docker-cover-e2e-binaries
264348
docker-cover-e2e-binaries: build-releaser
349+
<<<<<<< HEAD
265350
## Build for local architecture and for linux/amd64 for docker images.
266351
docker run --rm -u $(shell id -u):$(shell id -g) --volume $(PWD):/go/src/github.com/elastic/fleet-server -e SNAPSHOT=true $(BUILDER_IMAGE) cover-linux/$(shell go env GOARCH) cover-$(shell go env GOOS)/$(shell go env GOARCH)
352+
=======
353+
ifeq "${FIPS}" "true"
354+
## non-linux is currently unsupported for FIPS
355+
docker run --rm -u $(shell id -u):$(shell id -g) --volume $(PWD):/go/src/github.com/elastic/fleet-server -e SNAPSHOT=true -e DEV=$(DEV) -e FIPS=$(FIPS) $(BUILDER_IMAGE) cover-linux/$(shell go env GOARCH)
356+
else
357+
## Build for local architecture and for linux/$ARCH for docker images.
358+
docker run --rm -u $(shell id -u):$(shell id -g) --volume $(PWD):/go/src/github.com/elastic/fleet-server -e SNAPSHOT=true -e DEV=$(DEV) -e FIPS=$(FIPS) $(BUILDER_IMAGE) cover-linux/$(shell go env GOARCH) cover-$(shell go env GOOS)/$(shell go env GOARCH)
359+
endif
360+
>>>>>>> c83472b (Fix docker image build for FIPS variants (#4472))
267361

268362
.PHONY: release
269363
release: $(PLATFORM_TARGETS) ## - Builds a release. Specify exact platform with PLATFORMS env.
@@ -342,7 +436,7 @@ test-int-set: ## - Run integration tests without setup
342436
.PHONY: build-e2e-agent-image
343437
build-e2e-agent-image: docker-cover-e2e-binaries ## - Build a custom elastic-agent image with fleet-server binaries with coverage enabled injected
344438
@printf "${CMD_COLOR_ON} Creating test e2e agent image\n${CMD_COLOR_OFF}"
345-
FLEET_VERSION=${DEFAULT_VERSION}-SNAPSHOT ./dev-tools/e2e/build.sh # force fleet version to be equal to VERSION-SNAPSHOT
439+
FIPS=${FIPS} FLEET_VERSION=${DEFAULT_VERSION}-SNAPSHOT ./dev-tools/e2e/build.sh # force fleet version to be equal to VERSION-SNAPSHOT
346440

347441
.PHONY: e2e-certs
348442
e2e-certs: ## - Use openssl to create a CA, encrypted private key, and signed fleet-server cert testing purposes
@@ -376,9 +470,9 @@ test-e2e-set: ## - Run the blackbox end to end tests without setup.
376470
ELASTICSEARCH_SERVICE_TOKEN=$(shell ./dev-tools/integration/get-elasticsearch-servicetoken.sh ${ELASTICSEARCH_USERNAME}:${ELASTICSEARCH_PASSWORD}@${TEST_ELASTICSEARCH_HOSTS} "fleet-server") \
377471
ELASTICSEARCH_HOSTS=${TEST_ELASTICSEARCH_HOSTS} ELASTICSEARCH_USERNAME=${ELASTICSEARCH_USERNAME} ELASTICSEARCH_PASSWORD=${ELASTICSEARCH_PASSWORD} \
378472
AGENT_E2E_IMAGE=$(shell cat "build/e2e-image") \
379-
STANDALONE_E2E_IMAGE=$(DOCKER_IMAGE):$(DOCKER_IMAGE_TAG)$(if $(DEV),-dev,) \
473+
STANDALONE_E2E_IMAGE=$(DOCKER_IMAGE):$(DOCKER_IMAGE_TAG) \
380474
CGO_ENABLED=1 \
381-
go test -v -timeout 30m -tags=e2e -count=1 -race -p 1 ./...
475+
go test -v -timeout 30m -tags=e2e,$(GOBUILDTAGS) -count=1 -race -p 1 ./...
382476

383477
##################################################
384478
# Cloud testing targets

‎dev-tools/e2e/Dockerfile

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@ ARG ELASTIC_AGENT_IMAGE # e.g. docker.elastic.co/cloud-release/elastic-agent-clo
22

33
FROM --platform=linux/amd64 ${ELASTIC_AGENT_IMAGE} as elastic_agent_amd64
44
ARG STACK_VERSION # e.g. 8.5.0-SNAPSHOT
5+
ARG FLEET_SUFFIX # e.g. -linux-x86_64
56
ARG VCS_REF_SHORT # e.g. abc123
6-
ONBUILD COPY --chmod=0755 --chown=elastic-agent cover/fleet-server-${STACK_VERSION}-linux-x86_64/fleet-server \
7+
ONBUILD COPY --chmod=0755 --chown=elastic-agent cover/fleet-server-${STACK_VERSION}${FLEET_SUFFIX}/fleet-server \
78
./data/elastic-agent-${VCS_REF_SHORT}/components/fleet-server
89

910
FROM --platform=linux/arm64 ${ELASTIC_AGENT_IMAGE} as elastic_agent_arm64
1011
ARG STACK_VERSION # e.g. 8.5.0-SNAPSHOT
12+
ARG FLEET_SUFFIX # e.g. -linux-x86_64
1113
ARG VCS_REF_SHORT # e.g. abc123
12-
ONBUILD COPY --chmod=0755 --chown=elastic-agent cover/fleet-server-${STACK_VERSION}-linux-arm64/fleet-server \
14+
ONBUILD COPY --chmod=0755 --chown=elastic-agent cover/fleet-server-${STACK_VERSION}${FLEET_SUFFIX}/fleet-server \
1315
./data/elastic-agent-${VCS_REF_SHORT}/components/fleet-server
1416

1517
FROM elastic_agent_${TARGETARCH}

0 commit comments

Comments
 (0)
Please sign in to comment.