CKAD Mock Exam 6 Q5

I can’t figure out how to solve Question #5 without expanding “Solution” and pasting exactly what’s provided. I changed my indentations under spec.containers and both my container names, but my yaml would never pass validation for “running the right command”

My attempt:

apiVersion: v1
kind: Pod
metadata:
  creationTimestamp: null
  labels:
    run: static-web-server
  name: static-web-server
  namespace: ckad-multi-containers
spec:
  containers:
  - name: server-container
    image: alpine
    command:
      - sh
      - -c
      - echo Main application is running && sleep 3600
  initContainers:
  - name: init-myservice
    image: alpine
    command:
      - sh
      - -c
      - echo Getting main application ready! && sleep 10

Solution:

apiVersion: v1
kind: Pod
metadata:
  creationTimestamp: null
  labels:
    run: static-web-server
  name: static-web-server
  namespace: ckad-multi-containers
spec:
  containers:
    - name: server-container
      image: alpine
      command:
        - sh
        - -c
        - echo Main application is running && sleep 3600
  initContainers:
    - name: init-myservice
      image: alpine
      command:
        - sh
        - -c
        - echo Getting main application ready! && sleep 10

I just ran both versions of the YAML above. They both work for me - as they should.