Skip to content

Commit 9b9cc28

Browse files
committed
chore: improve error handling
1 parent b08f9e3 commit 9b9cc28

File tree

11 files changed

+1747
-237
lines changed

11 files changed

+1747
-237
lines changed

.github/workflows/test.yaml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Create Release
2+
on:
3+
pull_request: {}
4+
5+
push:
6+
branches:
7+
- main
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Start LocalStack
13+
uses: LocalStack/[email protected]
14+
with:
15+
image-tag: "latest"
16+
install-awslocal: "true"
17+
- name: Run Tests
18+
run: make test

Makefile

+11
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,19 @@ build:
7878
install:
7979
cp ./.bin/$(NAME) /usr/local/bin/
8080

81+
test: envtest
82+
go test -v ./...
83+
8184
.bin/upx: .bin
8285
wget -nv -O upx.tar.xz https://github.com/upx/upx/releases/download/v3.96/upx-3.96-$(ARCH)_$(OS).tar.xz
8386
tar xf upx.tar.xz
8487
mv upx-3.96-$(ARCH)_$(OS)/upx .bin
8588
rm -rf upx-3.96-$(ARCH)_$(OS)
89+
90+
ENVTEST_K8S_VERSION = 1.31.0
91+
ENVTEST_VERSION ?= release-0.19
92+
.PHONY: envtest
93+
envtest: $(ENVTEST) ## Download setup-envtest locally if necessary.
94+
$(ENVTEST): $(LOCALBIN)
95+
$(call go-install-tool,$(ENVTEST),sigs.k8s.io/controller-runtime/tools/setup-envtest,$(ENVTEST_VERSION))
96+

config-pod.yaml

+29-24
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,38 @@
1+
logLevel: debug
12
pod:
23
apiversion: v1
34
kind: Pod
45
metadata:
5-
name: "batch-{{.params.a}}"
6+
name: "batch-{{.a}}"
67
namespace: default
78
annotations:
8-
msg: "{{.msg | toJSON}}"
9+
msg: "{{. | toJSON}}"
910
spec:
1011
containers:
11-
- name: podinfo
12-
image: ghcr.io/stefanprodan/podinfo:5.1.4
13-
imagePullPolicy: IfNotPresent
14-
ports:
15-
- name: http
16-
containerPort: 9898
17-
protocol: TCP
18-
command:
19-
- ./podinfo
20-
- --port=9898
21-
- --port-metrics=9797
22-
- --grpc-port=9999
23-
- --grpc-service-name=podinfo
24-
- --level=info
25-
- --random-delay=false
26-
- --random-error=false
27-
env:
28-
- name: PODINFO_UI_COLOR
29-
value: "#34577c"
12+
- name: podinfo
13+
image: ghcr.io/stefanprodan/podinfo:5.1.4
14+
imagePullPolicy: IfNotPresent
15+
ports:
16+
- name: http
17+
containerPort: 9898
18+
protocol: TCP
19+
command:
20+
- ./podinfo
21+
- --port=9898
22+
- --port-metrics=9797
23+
- --grpc-port=9999
24+
- --grpc-service-name=podinfo
25+
- --level=info
26+
- --random-delay=false
27+
- --random-error=false
28+
env:
29+
- name: PODINFO_UI_COLOR
30+
value: "#34577c"
3031
sqs:
31-
queue: test-batch-runner
32-
account: 1234
33-
region: eu-west-1
32+
queue: arn:aws:sqs:us-east-1:000000000000:test-batch-runner
33+
endpoint: http://localhost:4566
34+
accessKey:
35+
value: test
36+
secretKey:
37+
value: test
38+
region: us-east-1

0 commit comments

Comments
 (0)