forked from mittwald/kubernetes-secret-generator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
42 lines (36 loc) · 1.35 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
SHELL=/bin/bash
NAMESPACE=default
KUBECONFIG=/tmp/kubeconfig
.PHONY: install
install: ## Install all resources (RBAC and Operator)
@echo ....... Applying Rules and Service Account .......
kubectl apply -f deploy/role.yaml -n ${NAMESPACE}
kubectl apply -f deploy/role_binding.yaml -n ${NAMESPACE}
kubectl apply -f deploy/service_account.yaml -n ${NAMESPACE}
@echo ....... Applying Operator .......
kubectl apply -f deploy/operator.yaml -n ${NAMESPACE}
.PHONY: uninstall
uninstall: ## Uninstall all that all performed in the $ make install
@echo ....... Uninstalling .......
@echo ....... Deleting Rules and Service Account .......
kubectl delete -f deploy/role.yaml -n ${NAMESPACE}
kubectl delete -f deploy/role_binding.yaml -n ${NAMESPACE}
kubectl delete -f deploy/service_account.yaml -n ${NAMESPACE}
@echo ....... Deleting Operator .......
kubectl delete -f deploy/operator.yaml -n ${NAMESPACE}
.PHONY: test
test: kind
@echo go test
go test ./... -v
.PHONY: fmt
fmt:
@echo go fmt
go fmt $$(go list ./...)
.PHONY: kind
kind: ## Create a kind cluster to test against
kind create cluster --name kind-k8s-secret-generator
kind get kubeconfig --internal --name kind-k8s-secret-generator | tee ${KUBECONFIG}
.PHONY: build
build:
operator-sdk build --go-build-args "-ldflags -X=version.Version=${SECRET_OPERATOR_VERSION}" ${DOCKER_IMAGE}
@exit $(.SHELLSTATUS)