Skip to content

Commit 3cbeb76

Browse files
committed
Bug Fix: Test suite false positive
1 parent d03fc8d commit 3cbeb76

File tree

2 files changed

+34
-33
lines changed

2 files changed

+34
-33
lines changed

charts/cluster/test/paradedb-minio-backup-restore/04-data_write.yaml

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,37 @@
1+
apiVersion: v1
2+
kind: ServiceAccount
3+
metadata:
4+
name: configmap-creator-sa
5+
---
6+
apiVersion: rbac.authorization.k8s.io/v1
7+
kind: Role
8+
metadata:
9+
name: configmap-creator
10+
rules:
11+
- apiGroups: [""]
12+
resources: ["configmaps"]
13+
verbs: ["create"]
14+
---
15+
apiVersion: rbac.authorization.k8s.io/v1
16+
kind: RoleBinding
17+
metadata:
18+
name: configmap-creator-binding
19+
subjects:
20+
- kind: ServiceAccount
21+
name: configmap-creator-sa
22+
roleRef:
23+
kind: Role
24+
name: configmap-creator
25+
apiGroup: rbac.authorization.k8s.io
26+
---
127
apiVersion: batch/v1
228
kind: Job
329
metadata:
430
name: data-write
531
spec:
632
template:
733
spec:
34+
serviceAccountName: configmap-creator-sa
835
restartPolicy: OnFailure
936
containers:
1037
- name: data-write
@@ -18,6 +45,10 @@ spec:
1845
command: ['sh', '-c']
1946
args:
2047
- |
21-
apk --no-cache add postgresql-client kubectl
48+
apk --no-cache add postgresql-client kubectl coreutils
2249
DB_URI=$(echo $DB_URI | sed "s|/\*|/|" )
2350
psql "$DB_URI" -c "CREATE TABLE mygoodtable (id serial PRIMARY KEY);"
51+
sleep 5
52+
DATE_NO_BAD_TABLE=$(date --rfc-3339=ns)
53+
kubectl create configmap date-no-bad-table --from-literal=date="$DATE_NO_BAD_TABLE"
54+
sleep 5
Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,10 @@
1-
apiVersion: v1
2-
kind: ServiceAccount
3-
metadata:
4-
name: configmap-creator-sa
5-
---
6-
apiVersion: rbac.authorization.k8s.io/v1
7-
kind: Role
8-
metadata:
9-
name: configmap-creator
10-
rules:
11-
- apiGroups: [""]
12-
resources: ["configmaps"]
13-
verbs: ["create"]
14-
---
15-
apiVersion: rbac.authorization.k8s.io/v1
16-
kind: RoleBinding
17-
metadata:
18-
name: configmap-creator-binding
19-
subjects:
20-
- kind: ServiceAccount
21-
name: configmap-creator-sa
22-
roleRef:
23-
kind: Role
24-
name: configmap-creator
25-
apiGroup: rbac.authorization.k8s.io
26-
---
271
apiVersion: batch/v1
282
kind: Job
293
metadata:
304
name: data-write-post-backup
315
spec:
326
template:
337
spec:
34-
serviceAccountName: configmap-creator-sa
358
restartPolicy: OnFailure
369
containers:
3710
- name: data-write
@@ -49,9 +22,6 @@ spec:
4922
command: ['sh', '-c']
5023
args:
5124
- |
52-
apk --no-cache add postgresql-client kubectl coreutils
25+
apk --no-cache add postgresql-client
5326
DB_URI=$(echo $DB_URI | sed "s|/\*|/|" )
54-
DATE_NO_BAD_TABLE=$(date --rfc-3339=ns)
55-
sleep 30
56-
psql "$DB_URI" -c "CREATE TABLE mybadtable (id serial PRIMARY KEY);"
57-
kubectl create configmap date-no-bad-table --from-literal=date="$DATE_NO_BAD_TABLE"
27+
psql "$DB_URI" -c "CREATE TABLE mybadtable (id serial PRIMARY KEY);"

0 commit comments

Comments
 (0)