Skip to content

Commit 73ef309

Browse files
Merge pull request #11 from DataDog/agaillard/fips
Build in FIPS mode
2 parents 93bd4f9 + cdcd088 commit 73ef309

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
@@ -78,7 +78,7 @@ BUILD_PLATFORMS =
7878

7979
# Add go ldflags using LDFLAGS at the time of compilation.
8080
IMPORTPATH_LDFLAGS = -X main.version=$(REV)
81-
EXT_LDFLAGS = -extldflags "-static"
81+
EXT_LDFLAGS =
8282
LDFLAGS =
8383
FULL_LDFLAGS = $(LDFLAGS) $(IMPORTPATH_LDFLAGS) $(EXT_LDFLAGS)
8484
# This builds each command (= the sub-directories of ./cmd) for the target platform(s)
@@ -94,7 +94,7 @@ $(CMDS:%=build-%): build-%: check-go-version-go
9494
if ! [ $${#os_arch_seen_pre} = $${#os_arch_seen} ]; then \
9595
continue; \
9696
fi; \
97-
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 \
97+
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 \
9898
echo "Building $* for GOOS=$$os GOARCH=$$arch failed, see error(s) above."; \
9999
exit 1; \
100100
fi; \

0 commit comments

Comments
 (0)