Open WJay-tec opened 10 months ago
after digging some more, i realise the pre-workflow-hook actually failed, but the logs outputted it as successfully ran.
{"level":"info","ts":"2023-11-17T03:20:43.133Z","caller":"runtime/pre_workflow_hook_runner.go:80","msg":"successfully ran \"sh -c cd terraform/L0/01-accounts\\nterraform init\\nterraform output -json | jq '[.short_name_account_ids.value | to_entries[] | .key]' > /tmp/$HEAD_COMMIT.yaml\\necho '---' | cat - /tmp/$HEAD_COMMIT.yaml > temp && mv temp /tmp/$HEAD_COMMIT.yaml\\necho '#@data/values' | cat - /tmp/$HEAD_COMMIT.yaml > temp && mv temp /tmp/$HEAD_COMMIT.yaml\\n\" in \"/atlantis-data/repos/dbmy/sre/infrastructure/2411/default\"","json":{"repo":"dbmy/sre/infrastructure","pull":"2411"}}{"level":"info","ts":"2023-11-17T03:20:44.179Z","caller":"runtime/pre_workflow_hook_runner.go:80","msg":"successfully ran \"sh -c ytt -f atlantis.yaml -f /tmp/$HEAD_COMMIT.yaml > atlantis2.yaml\\nmv atlantis2.yaml atlantis.yaml\\n\" in \"/atlantis-data/repos/dbmy/sre/infrastructure/2411/default\"","json":{"repo":"dbmy/sre/infrastructure","pull":"2411"}}
When i run the same exact command with the same data locally, i get an error.
ytt: Error:
- __ytt_tpl3_start_node: expected key 'name' to not be specified again (unless 'yaml/map-key-override' annotation is added)
Feel like the error handling here did not throw the error when the workflow run failed, do correct me if i am wrong. The logs made debugging harder since i thought the workflow run was successful.
Community Note
Overview of the Issue
I am trying to implement yaml anchors with my atlantis.yaml file, but an error shown below is thrown when atlantis plan is ran.
parsing atlantis.yaml: version: is required. If you've just upgraded Atlantis you need to rewrite your atlantis.yaml for version 3. See www.runatlantis.io/docs/upgrading-atlantis-yaml.html.
example anchor:
Does using pre_workflow_hooks to modify atlantis.yaml prevents me from using yaml anchors? Cause i am using pre_workflow_hook now to dynamically generate some parts of my atlantis.yaml entries.
Logs
Environment details