Skip to content
This repository has been archived by the owner on Jun 28, 2024. It is now read-only.

Commit

Permalink
ci: use $EPOCHREALTIME to compare container start time
Browse files Browse the repository at this point in the history
In some case the `date +%s` may get the same value
in initContainer and normal container, use $EPOCHREALTIME
can ensure that the values are different.

Fixes: #2783

Signed-off-by: bin liu <bin@hyper.sh>
  • Loading branch information
liubin committed Aug 13, 2020
1 parent 424b790 commit fc9f21b
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ spec:
initContainers:
- name: first
image: busybox
command: [ "sh", "-c", "date +%s > /volume/initContainer" ]
command: [ "sh", "-c", "echo ${EPOCHREALTIME//.} > /volume/initContainer" ]
volumeMounts:
- mountPath: /volume
name: volume
containers:
- name: last
image: busybox
command: [ "sh", "-c", "date +%s > /volume/container; tail -f /dev/null" ]
command: [ "sh", "-c", "echo ${EPOCHREALTIME//.} > /volume/container; tail -f /dev/null" ]
volumeMounts:
- mountPath: /volume
name: volume
Expand Down

0 comments on commit fc9f21b

Please # to comment.