Skip to content
Compare
Choose a tag to compare
@github-actions github-actions released this 09 May 09:57
· 18 commits to refs/heads/main since this release
e539612
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

Screen Shot 2023-04-27 at 3 20 10 PM

The URL does not display:

Screen Shot 2023-05-08 at 2 30 55 PM

  • 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 from jsonpath since it supports first 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.

Screen Shot 2023-05-08 at 2 28 02 PM

references