Skip to content

Commit eeac9df

Browse files
authored
chore: add a binary makefile target (#7704)
1 parent ed5f461 commit eeac9df

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,6 @@ go.work.sum
1414

1515
# Project Specific
1616
*.csv
17+
18+
# Binary output
19+
karpenter-provider-aws-*

Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ KARPENTER_CORE_DIR = $(shell go list -m -f '{{ .Dir }}' sigs.k8s.io/karpenter)
3434
# TEST_SUITE enables you to select a specific test suite directory to run "make e2etests" against
3535
TEST_SUITE ?= "..."
3636

37+
# Filename when building the binary controller only
38+
GOARCH ?= $(shell go env GOARCH)
39+
BINARY_FILENAME = karpenter-provider-aws-$(GOARCH)
40+
3741
help: ## Display help
3842
@awk 'BEGIN {FS = ":.*##"; printf "Usage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
3943

@@ -132,6 +136,9 @@ image: ## Build the Karpenter controller images using ko build
132136
$(eval IMG_TAG=$(shell echo $(CONTROLLER_IMG) | cut -d "@" -f 1 | cut -d ":" -f 2 -s))
133137
$(eval IMG_DIGEST=$(shell echo $(CONTROLLER_IMG) | cut -d "@" -f 2))
134138

139+
binary: ## Build the Karpenter controller binary using go build
140+
go build $(GOFLAGS) -o $(BINARY_FILENAME) ./cmd/controller/...
141+
135142
apply: verify image ## Deploy the controller from the current state of your git repository into your ~/.kube/config cluster
136143
kubectl apply -f ./pkg/apis/crds/
137144
helm upgrade --install karpenter charts/karpenter --namespace ${KARPENTER_NAMESPACE} \

0 commit comments

Comments
 (0)