|
1 | 1 | .PHONY: test |
2 | 2 | test: |
3 | | - @echo "\n🛠️ Running unit tests..." |
| 3 | + @echo "🛠️ Running unit tests..." |
4 | 4 | go test ./... |
5 | 5 |
|
6 | 6 | .PHONY: build |
7 | 7 | build: |
8 | | - @echo "\n🔧 Building Go binaries..." |
9 | | - GOOS=darwin GOARCH=amd64 go build -o bin/admission-webhook-darwin-amd64 . |
10 | | - GOOS=linux GOARCH=amd64 go build -o bin/admission-webhook-linux-amd64 . |
| 8 | + @echo "🔧 Building Go binaries..." |
| 9 | + go build -o bin/admission-webhook-linux-amd64 . |
11 | 10 |
|
12 | | -.PHONY: docker-build |
13 | | -docker-build: |
14 | | - @echo "\n📦 Building simple-kubernetes-webhook Docker image..." |
15 | | - docker build -t simple-kubernetes-webhook:latest . |
| 11 | +.PHONY: podman-build |
| 12 | +podman-build: |
| 13 | + @echo "📦 Building simple-kubernetes-webhook podman image..." |
| 14 | + podman build -t simple-kubernetes-webhook:1.0 . |
16 | 15 |
|
17 | | -# From this point `kind` is required |
18 | 16 | .PHONY: cluster |
19 | 17 | cluster: |
20 | | - @echo "\n🔧 Creating Kubernetes cluster..." |
| 18 | + @echo "🔧 Creating Kubernetes cluster..." |
21 | 19 | kind create cluster --config dev/manifests/kind/kind.cluster.yaml |
22 | 20 |
|
23 | 21 | .PHONY: delete-cluster |
24 | 22 | delete-cluster: |
25 | | - @echo "\n♻️ Deleting Kubernetes cluster..." |
| 23 | + @echo "♻️ Deleting Kubernetes cluster..." |
26 | 24 | kind delete cluster |
27 | 25 |
|
28 | 26 | .PHONY: push |
29 | | -push: docker-build |
30 | | - @echo "\n📦 Pushing admission-webhook image into Kind's Docker daemon..." |
31 | | - kind load docker-image simple-kubernetes-webhook:latest |
| 27 | +push: podman-build |
| 28 | + @echo "📦 Pushing admission-webhook image into Kind's podman daemon..." |
| 29 | + rm -f image.tardeplo |
| 30 | + podman save simple-kubernetes-webhook:1.0 -o image.tar |
| 31 | + kind load image-archive image.tar |
32 | 32 |
|
33 | 33 | .PHONY: deploy-config |
34 | 34 | deploy-config: |
35 | | - @echo "\n⚙️ Applying cluster config..." |
| 35 | + @echo "⚙️ Applying cluster config..." |
36 | 36 | kubectl apply -f dev/manifests/cluster-config/ |
37 | 37 |
|
38 | 38 | .PHONY: delete-config |
39 | 39 | delete-config: |
40 | | - @echo "\n♻️ Deleting Kubernetes cluster config..." |
| 40 | + @echo "♻️ Deleting Kubernetes cluster config..." |
41 | 41 | kubectl delete -f dev/manifests/cluster-config/ |
42 | 42 |
|
43 | 43 | .PHONY: deploy |
44 | 44 | deploy: push delete deploy-config |
45 | | - @echo "\n🚀 Deploying simple-kubernetes-webhook..." |
| 45 | + @echo "🚀 Deploying simple-kubernetes-webhook..." |
46 | 46 | kubectl apply -f dev/manifests/webhook/ |
47 | 47 |
|
48 | 48 | .PHONY: delete |
49 | 49 | delete: |
50 | | - @echo "\n♻️ Deleting simple-kubernetes-webhook deployment if existing..." |
| 50 | + @echo "♻️ Deleting simple-kubernetes-webhook deployment if existing..." |
51 | 51 | kubectl delete -f dev/manifests/webhook/ || true |
52 | 52 |
|
53 | 53 | .PHONY: pod |
54 | 54 | pod: |
55 | | - @echo "\n🚀 Deploying test pod..." |
| 55 | + @echo "🚀 Deploying test pod..." |
56 | 56 | kubectl apply -f dev/manifests/pods/lifespan-seven.pod.yaml |
57 | 57 |
|
58 | 58 | .PHONY: delete-pod |
59 | 59 | delete-pod: |
60 | | - @echo "\n♻️ Deleting test pod..." |
| 60 | + @echo "♻️ Deleting test pod..." |
61 | 61 | kubectl delete -f dev/manifests/pods/lifespan-seven.pod.yaml |
62 | 62 |
|
63 | 63 | .PHONY: bad-pod |
64 | 64 | bad-pod: |
65 | | - @echo "\n🚀 Deploying \"bad\" pod..." |
| 65 | + @echo "🚀 Deploying \"bad\" pod..." |
66 | 66 | kubectl apply -f dev/manifests/pods/bad-name.pod.yaml |
67 | 67 |
|
68 | 68 | .PHONY: delete-bad-pod |
69 | 69 | delete-bad-pod: |
70 | | - @echo "\n🚀 Deleting \"bad\" pod..." |
| 70 | + @echo "🚀 Deleting \"bad\" pod..." |
71 | 71 | kubectl delete -f dev/manifests/pods/bad-name.pod.yaml |
72 | 72 |
|
73 | 73 | .PHONY: taint |
74 | 74 | taint: |
75 | | - @echo "\n🎨 Taining Kubernetes node.." |
| 75 | + @echo "🎨 Taining Kubernetes node.." |
76 | 76 | kubectl taint nodes kind-control-plane "acme.com/lifespan-remaining"=4:NoSchedule |
77 | 77 |
|
78 | 78 | .PHONY: logs |
79 | 79 | logs: |
80 | | - @echo "\n🔍 Streaming simple-kubernetes-webhook logs..." |
| 80 | + @echo "🔍 Streaming simple-kubernetes-webhook logs..." |
81 | 81 | kubectl logs -l app=simple-kubernetes-webhook -f |
82 | 82 |
|
83 | 83 | .PHONY: delete-all |
|
0 commit comments