apiVersion: v1
kind: Pod
metadata:
  name: test-empty-volume
  namespace: default
  annotations:
    alpha.kinvolk.io/userns: "pod"
spec:
  restartPolicy: Never
  containers:
  - name: reader
    image: busybox
    command: ["sh"]
    args: ["-c", 'content=$(cat /cache2/foo.txt); if [[ "$content" != "bar" ]]; then exit 1; else exit 0; fi']
    volumeMounts:
    - mountPath: /cache2
      name: cache-volume
  initContainers:
  - name: writer
    image: busybox
    command: ["sh"]
    args: ["-c", "echo 'bar' > /cache1/foo.txt"]
    volumeMounts:
    - mountPath: /cache1
      name: cache-volume
  volumes:
    - name: cache-volume
      emptyDir: {}
