From ba783288015a6f5d44fea6e18c70ba9866d13431 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Apayd=C4=B1n?= Date: Fri, 11 Feb 2022 17:34:29 +0300 Subject: [PATCH] feat: add bunch of ldflags for reproducibility MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Batuhan Apaydın --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 5eabecb..fc1b411 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,7 @@ else BUILD_DATE ?= $(shell date $(DATE_FMT)) endif PKG=github.com/hashicorp/vault-csi-provider/internal/version -LDFLAGS?="-X '$(PKG).BuildVersion=$(VERSION)' \ +LDFLAGS?="-s -w -extldflags=-zrelro -extldflags=-znow -X '$(PKG).BuildVersion=$(VERSION)' \ -X '$(PKG).BuildDate=$(BUILD_DATE)' \ -X '$(PKG).GoVersion=$(shell go version)'" K8S_VERSION?=v1.22.2 @@ -41,6 +41,7 @@ lint: build: CGO_ENABLED=0 go build \ + -trimpath \ -ldflags $(LDFLAGS) \ -o dist/ \ .