Skip to content

Commit a81be6f

Browse files
antoine-gaillarddatadog-compute-robot
authored andcommitted
Build in fips mode
1 parent 308bac4 commit a81be6f

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

cmd/csi-snapshotter/fips.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
//go:build fips
2+
3+
package main
4+
5+
import _ "crypto/tls/fipsonly"

cmd/snapshot-controller/fips.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
//go:build fips
2+
3+
package main
4+
5+
import _ "crypto/tls/fipsonly"

release-tools/build.make

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ BUILD_PLATFORMS =
7979

8080
# Add go ldflags using LDFLAGS at the time of compilation.
8181
IMPORTPATH_LDFLAGS = -X main.version=$(REV)
82-
EXT_LDFLAGS = -extldflags "-static"
82+
EXT_LDFLAGS =
8383
LDFLAGS =
8484
FULL_LDFLAGS = $(LDFLAGS) $(IMPORTPATH_LDFLAGS) $(EXT_LDFLAGS)
8585
# This builds each command (= the sub-directories of ./cmd) for the target platform(s)
@@ -95,7 +95,7 @@ $(CMDS:%=build-%): build-%: check-go-version-go
9595
if ! [ $${#os_arch_seen_pre} = $${#os_arch_seen} ]; then \
9696
continue; \
9797
fi; \
98-
if ! (set -x; cd ./$(CMDS_DIR)/$* && CGO_ENABLED=0 GOOS="$$os" GOARCH="$$arch" go build $(GOFLAGS_VENDOR) -a -ldflags '$(FULL_LDFLAGS)' -o "$(abspath ./bin)/$*$$suffix" .); then \
98+
if ! (set -x; cd ./$(CMDS_DIR)/$* && CGO_ENABLED=1 GOEXPERIMENT=boringcrypto GOOS="$$os" GOARCH="$$arch" go build $(GOFLAGS_VENDOR) -a -ldflags '$(FULL_LDFLAGS)' -tags fips -o "$(abspath ./bin)/$*$$suffix" . && go tool nm "$(abspath ./bin)/$*$$suffix" | grep 'sig\.FIPSOnly'); then \
9999
echo "Building $* for GOOS=$$os GOARCH=$$arch failed, see error(s) above."; \
100100
exit 1; \
101101
fi; \

0 commit comments

Comments
 (0)