forked from luksa/kubernetes-in-action-2nd-edition
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pod.date-test.yaml
46 lines (43 loc) · 1.34 KB
/
pod.date-test.yaml
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
43
44
45
46
apiVersion: v1
kind: Pod
metadata:
name: date-test
spec:
restartPolicy: OnFailure
containers:
- name: mongo
image: mongo:5
command:
- sh
- -c
- |
mongosh mongodb+srv://quiz-pods.kiada.svc.cluster.local/kiada?tls=false --quiet --file /dev/stdin <<EOF
testDate(new Date("2020-01-01Z"));
testDate(new Date("2020-02-01Z"));
testDate(new Date("2020-03-01Z"));
testDate(new Date("2020-04-01Z"));
testDate(new Date("2020-10-01Z"));
testDate(new Date("2020-11-01Z"));
testDate(new Date("2020-12-01Z"));
testDate(new Date("2021-01-01Z"));
testDate(new Date("2021-02-01Z"));
testDate(new Date("2021-03-01Z"));
testDate(new Date("2021-04-01Z"));
testDate(new Date("2021-10-01Z"));
testDate(new Date("2021-11-01Z"));
testDate(new Date("2021-12-01Z"));
testDate(new Date("2022-01-01Z"));
testDate(new Date("2022-02-01Z"));
testDate(new Date("2022-03-01Z"));
testDate(new Date("2022-04-01Z"));
testDate(new Date("2022-10-01Z"));
testDate(new Date("2022-11-01Z"));
testDate(new Date("2022-12-01Z"));
function testDate(date) {
var date2 = new Date(date);
date2.setMonth(date2.getMonth() + 1);
print("date1: " + date);
print("date2: " + date2);
print();
}
EOF