·
18 commits
to refs/heads/main
since this release
Handle multiple matching ingresses for output-url @ozydingo (#35)
Github actions cannot support having multiple output urls for an environment. Switch the strategy to use jq
's first
function so that at least some valid URL is displayed if present. Punts on how to determine which URL would be preferred in the case of multiple.
what
- Output only a single URL for
webapp-url
when a deployment has multiple ingresses - Choose the first matching ingress as a reasonable guess as to which ingress is preferred to display in the github action step.
why
- When there are multiple ingresses, the current script outputs all of their URLS:
⨠ kubectl --namespace pr-13904 get -l app.kubernetes.io/name=app ingress --output=jsonpath='{.items[*].metadata.annotations.outputs\.webapp-url}'
https://ops-pr-13904.3paw-dev.com https://ops-pr-13904.3paw-dev.co
This causes the github action to fail to display the environment url

The URL does not display:
- First is a a step in the direction over invalid, though this could get more configurable. (In our case, both ingresses have the same url anyway.)
- Change to
jq
fromjsonpath
since it supportsfirst
even if there are no matches.jsonpath
using[0]
, on the other hand, will blow up
testing
Here is a PR that uses the new code, and is showing the preview env URL successfully.
references
- https://github.com/3playmedia-dev/threeplaymedia_app3/actions/runs/4823321955 (using main, url not showing)
- https://github.com/3playmedia-dev/threeplaymedia_app3/actions/runs/4918233468 (using this branch, url is showing up)