mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 22:46:12 +00:00
PodSecurity: Set version build flags in makefile
Change-Id: I719e7ce1efce9014e24903f0ad203a52a207f892
This commit is contained in:
parent
2a4701c2ca
commit
0be8280faa
@ -17,6 +17,9 @@
|
|||||||
ENTRYPOINT = "../cmd/webhook/webhook.go"
|
ENTRYPOINT = "../cmd/webhook/webhook.go"
|
||||||
EXECUTABLE = "pod-security-webhook"
|
EXECUTABLE = "pod-security-webhook"
|
||||||
|
|
||||||
|
# Relative to location in staging dir
|
||||||
|
KUBE_ROOT = "../../../../.."
|
||||||
|
|
||||||
IMAGE_DOCKERFILE = "Dockerfile"
|
IMAGE_DOCKERFILE = "Dockerfile"
|
||||||
REGISTRY ?= "gcr.io/k8s-staging-sig-auth"
|
REGISTRY ?= "gcr.io/k8s-staging-sig-auth"
|
||||||
IMAGE ?= "$(REGISTRY)/pod-security-webhook"
|
IMAGE ?= "$(REGISTRY)/pod-security-webhook"
|
||||||
@ -28,8 +31,8 @@ ARCH ?= amd64
|
|||||||
# Builds the PodSecurity webhook binary.
|
# Builds the PodSecurity webhook binary.
|
||||||
build:
|
build:
|
||||||
@echo Building PodSecurity webhook...
|
@echo Building PodSecurity webhook...
|
||||||
@GOOS=$(OS) GOARCH=$(ARCH) CGO_ENABLED=0 \
|
@LDFLAGS=`cd -P . && /usr/bin/env bash -c '. $(KUBE_ROOT)/hack/lib/version.sh && KUBE_ROOT=$(KUBE_ROOT) KUBE_GO_PACKAGE=k8s.io/kubernetes kube::version::ldflags'`; \
|
||||||
go build -o $(EXECUTABLE) $(ENTRYPOINT)
|
GOOS=$(OS) GOARCH=$(ARCH) CGO_ENABLED=0 go build -o $(EXECUTABLE) -ldflags "$$LDFLAGS" $(ENTRYPOINT)
|
||||||
@echo Done!
|
@echo Done!
|
||||||
|
|
||||||
# Builds the PodSecurity webhook Docker image.
|
# Builds the PodSecurity webhook Docker image.
|
||||||
@ -46,4 +49,4 @@ push:
|
|||||||
|
|
||||||
# Removes Pod Security Webhook artifacts.
|
# Removes Pod Security Webhook artifacts.
|
||||||
clean:
|
clean:
|
||||||
rm $(EXECUTABLE)
|
rm $(EXECUTABLE)
|
||||||
|
Loading…
Reference in New Issue
Block a user