Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
download toolchain if not present
  • Loading branch information
cjerad committed Apr 15, 2022
commit 053e2a88624d9cdb82bbd0d004c228327cb3603a
6 changes: 0 additions & 6 deletions BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@ git clone --branch v2 https://github.com/aws/aws-node-termination-handler.git
cd aws-node-termination-handler
```

## Install build tools

```sh
make toolchain
```

## Set environment variables

```sh
Expand Down
11 changes: 7 additions & 4 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))
CONTROLLER_GEN = $(PROJECT_DIR)/bin/controller-gen
KO = $(PROJECT_DIR)/bin/ko
ENVTEST = $(PROJECT_DIR)/bin/setup-envtest
TOOLCHAIN = \
$(CONTROLLER_GEN) \
$(KO) \
$(ENVTEST)
HELM_BASE_OPTS ?= --set serviceAccount.annotations.eks\\.amazonaws\\.com/role-arn=${NTHV2_IAM_ROLE_ARN}
GINKGO_BASE_OPTS ?= --coverpkg $(shell head -n 1 $(PROJECT_DIR)/go.mod | cut -s -d ' ' -f 2)/pkg/...
KODATA = \
Expand Down Expand Up @@ -45,14 +49,13 @@ SHELL = /usr/bin/env bash -o pipefail
help: ## Display this help.
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\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)

.PHONY: toolchain
toolchain: ## Download additional tools.
$(TOOLCHAIN) &:
@./scripts/toolchain.sh -d "$(PROJECT_DIR)/bin"

##@ Development

.PHONY: generate
generate: ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
generate: $(CONTROLLER_GEN) ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..."

.PHONY: verify
Expand All @@ -78,7 +81,7 @@ $(KODATA):
cd $(@D) && ln -s `git rev-parse --git-path $(@F)` $(@F)

.PHONY: apply
apply: $(KODATA) ## Deploy the controller into the current kubernetes cluster.
apply: $(KO) $(KODATA) ## Deploy the controller into the current kubernetes cluster.
helm upgrade --install dev charts/aws-node-termination-handler-2 --namespace nthv2 --create-namespace \
$(HELM_BASE_OPTS) \
$(HELM_OPTS) \
Expand Down