Skip to content

Commit 1295b6f

Browse files
author
Arvind Thirumurugan
committed
restructure dirs
Signed-off-by: Arvind Thirumurugan <arvindth@microsoft.com>
1 parent 76de5f3 commit 1295b6f

File tree

58 files changed

+4875
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+4875
-0
lines changed
115 KB
Loading
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# Makefile for ApprovalRequest Controller
2+
3+
# Image settings
4+
IMAGE_NAME ?= approval-request-controller
5+
IMAGE_TAG ?= latest
6+
REGISTRY ?=
7+
8+
# Build settings
9+
GOOS ?= $(shell go env GOOS)
10+
GOARCH ?= $(shell go env GOARCH)
11+
12+
# Tools
13+
CONTROLLER_GEN_VERSION ?= v0.16.0
14+
CONTROLLER_GEN = go run sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_GEN_VERSION)
15+
16+
.PHONY: help
17+
help: ## Display this help
18+
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
19+
20+
##@ Code Generation
21+
22+
.PHONY: manifests
23+
manifests: ## Generate CRD manifests
24+
$(CONTROLLER_GEN) crd paths="./apis/..." output:crd:artifacts:config=config/crd/bases
25+
26+
.PHONY: generate
27+
generate: ## Generate DeepCopy code
28+
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./apis/..."
29+
30+
##@ Build
31+
32+
.PHONY: docker-build
33+
docker-build: ## Build docker image
34+
docker buildx build \
35+
--file docker/approval-request-controller.Dockerfile \
36+
--output=type=docker \
37+
--platform=linux/$(GOARCH) \
38+
--build-arg GOARCH=$(GOARCH) \
39+
--tag $(IMAGE_NAME):$(IMAGE_TAG) \
40+
.
41+
42+
.PHONY: docker-push
43+
docker-push: ## Push docker image
44+
docker push $(REGISTRY)$(IMAGE_NAME):$(IMAGE_TAG)
45+
46+
##@ Development
47+
48+
.PHONY: run
49+
run: ## Run controller locally
50+
go run ./cmd/approvalrequestcontroller/main.go
51+
52+
##@ Deployment
53+
54+
.PHONY: install
55+
install: ## Install helm chart
56+
helm install approval-request-controller ./charts/approval-request-controller \
57+
--namespace fleet-system \
58+
--create-namespace \
59+
--set image.repository=$(IMAGE_NAME) \
60+
--set image.tag=$(IMAGE_TAG)
61+
62+
.PHONY: upgrade
63+
upgrade: ## Upgrade helm chart
64+
helm upgrade approval-request-controller ./charts/approval-request-controller \
65+
--namespace fleet-system \
66+
--set image.repository=$(IMAGE_NAME) \
67+
--set image.tag=$(IMAGE_TAG)
68+
69+
.PHONY: uninstall
70+
uninstall: ## Uninstall helm chart
71+
helm uninstall approval-request-controller --namespace fleet-system
72+
73+
##@ Kind
74+
75+
.PHONY: kind-load
76+
kind-load: docker-build ## Build and load image into kind cluster
77+
kind load docker-image $(IMAGE_NAME):$(IMAGE_TAG) --name hub

0 commit comments

Comments
 (0)