Yamato Tanaka 346cda59b6 Improve volumes format check of yaml-validate.py
Currently, yaml-validate.py cannot detect trailing slashes under
"list_concat" and "if".

  volumes:
    - /example:/example/ # <======= detected

  volumes:
    list_concat:
    - - /example1:/example1/ # <===== not detected
      - /example2:/example2
    - if:
      - {get_param: TestValue}
      - - /example3:/example3/ # <==== not detected
        - /example4:/example4

This fix makes yaml-validate.py detect the these trailing slashes.

Because the current implementation digs "list" twice in one call to
check_volumes(), trailing slashes under "list_concat" are not detected.
Because the current implementation ignores "if", trailing slashes under
"if" are not deleted. check_volumes() doesn't have to ignore "if"
because non-volume-style value is ignored because of IndexError.

Change-Id: I4288738c2c95ab990024845fa43653854e790bd8
(cherry picked from commit d940f586147e40e52b53b44c239e113a6d460747)
2022-11-28 17:09:32 +09:00
..
2021-03-31 17:35:12 +05:30