Skip to content

Commit

Permalink
chore: add a binary makefile target (#7704)
Browse files Browse the repository at this point in the history
  • Loading branch information
elmiko authored Feb 7, 2025
1 parent ed5f461 commit eeac9df
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ go.work.sum

# Project Specific
*.csv

# Binary output
karpenter-provider-aws-*
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ KARPENTER_CORE_DIR = $(shell go list -m -f '{{ .Dir }}' sigs.k8s.io/karpenter)
# TEST_SUITE enables you to select a specific test suite directory to run "make e2etests" against
TEST_SUITE ?= "..."

# Filename when building the binary controller only
GOARCH ?= $(shell go env GOARCH)
BINARY_FILENAME = karpenter-provider-aws-$(GOARCH)

help: ## Display help
@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)

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

binary: ## Build the Karpenter controller binary using go build
go build $(GOFLAGS) -o $(BINARY_FILENAME) ./cmd/controller/...

apply: verify image ## Deploy the controller from the current state of your git repository into your ~/.kube/config cluster
kubectl apply -f ./pkg/apis/crds/
helm upgrade --install karpenter charts/karpenter --namespace ${KARPENTER_NAMESPACE} \
Expand Down

0 comments on commit eeac9df

Please sign in to comment.