You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix docker image build for FIPS variants (#4472) (#4501)
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)
Co-authored-by: Michel Laterman <82832767+michel-laterman@users.noreply.github.com>
@curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/d58dbde584c801091e74a00940e11ff18c6c68bd/install.sh | sh -s v1.61.0
186
+
@curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/d58dbde584c801091e74a00940e11ff18c6c68bd/install.sh | sh -s v1.64.5
150
187
@./bin/golangci-lint run -v
151
188
152
189
.PHONY: notice
@@ -185,11 +222,11 @@ test-release: ## - Check that all release binaries are created
185
222
186
223
.PHONY: test-unit
187
224
test-unit: prepare-test-context ## - Run unit tests only
188
-
set -o pipefail; go test${GO_TEST_FLAG}$(if$(FIPS),-tags="requirefips",) -v -race -coverprofile=build/coverage-${OS_NAME}.out ./... | tee build/test-unit-${OS_NAME}.out
225
+
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
189
226
190
227
.PHONY: benchmark
191
228
benchmark: prepare-test-context install-benchstat ## - Run benchmark tests only
192
-
set -o pipefail; go test -bench=$(BENCHMARK_FILTER)$(if$(FIPS),-tags="requirefips",) -run=$(BENCHMARK_FILTER)$(BENCHMARK_ARGS)$(BENCHMARK_PACKAGE)| tee "build/$(BENCH_BASE)"
229
+
set -o pipefail; go test -bench=$(BENCHMARK_FILTER) -tags=$(GOBUILDTAGS) -run=$(BENCHMARK_FILTER)$(BENCHMARK_ARGS)$(BENCHMARK_PACKAGE)| tee "build/$(BENCH_BASE)"
193
230
194
231
.PHONY: install-benchstat
195
232
install-benchstat: ## - Install the benchstat package
build-releaser: ## - Build a Docker image to run make package including all build tools
@@ -290,8 +328,13 @@ docker-release: build-releaser ## - Builds a release for all platforms in a dock
290
328
291
329
.PHONY: docker-cover-e2e-binaries
292
330
docker-cover-e2e-binaries: build-releaser
331
+
ifeq "${FIPS}" "true"
332
+
## non-linux is currently unsupported for FIPS
333
+
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)
334
+
else
293
335
## Build for local architecture and for linux/$ARCH for docker images.
294
-
docker run --rm -u $(shell id -u):$(shell id -g) --volume $(PWD):/go/src/github.com/elastic/fleet-server -e SNAPSHOT=true $(if$(FIPS),-e FIPS=true)$(BUILDER_IMAGE) cover-linux/$(shell go env GOARCH) cover-$(shell go env GOOS)/$(shell go env GOARCH)
336
+
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)
337
+
endif
295
338
296
339
.PHONY: release
297
340
release: $(PLATFORM_TARGETS)## - Builds a release. Specify exact platform with PLATFORMS env.
@@ -370,7 +413,7 @@ test-int-set: ## - Run integration tests without setup
370
413
.PHONY: build-e2e-agent-image
371
414
build-e2e-agent-image: docker-cover-e2e-binaries ## - Build a custom elastic-agent image with fleet-server binaries with coverage enabled injected
372
415
@printf "${CMD_COLOR_ON} Creating test e2e agent image\n${CMD_COLOR_OFF}"
373
-
FLEET_VERSION=${DEFAULT_VERSION}-SNAPSHOT ./dev-tools/e2e/build.sh # force fleet version to be equal to VERSION-SNAPSHOT
416
+
FIPS=${FIPS}FLEET_VERSION=${DEFAULT_VERSION}-SNAPSHOT ./dev-tools/e2e/build.sh # force fleet version to be equal to VERSION-SNAPSHOT
374
417
375
418
.PHONY: e2e-certs
376
419
e2e-certs: ## - Use openssl to create a CA, encrypted private key, and signed fleet-server cert testing purposes
@@ -404,9 +447,9 @@ test-e2e-set: ## - Run the blackbox end to end tests without setup.
0 commit comments