Skip to content

Commit

Permalink
Handle multiple matching ingresses for output-url (#35)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ozydingo authored May 8, 2023
1 parent e0cbd1a commit e539612
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ if [[ "${OPERATION}" == "deploy" ]]; then
RELEASES=$(helmfile ${BASIC_ARGS} ${EXTRA_VALUES_ARGS} ${DEBUG_ARGS} list --output json | jq .[].name -r)
for RELEASE in ${RELEASES}
do
ENTRYPOINT=$(kubectl --namespace ${NAMESPACE} get -l ${RELEASE_LABEL_NAME}=${RELEASE} ingress --output=jsonpath='{.items[*].metadata.annotations.outputs\.webapp-url}')
ENTRYPOINT=$(kubectl --namespace ${NAMESPACE} get -l ${RELEASE_LABEL_NAME}=${RELEASE} ingress -o json | jq --raw-output '[.items[].metadata.annotations["outputs.webapp-url"]] | first')
if [[ "${ENTRYPOINT}" != "" ]]; then
echo "webapp-url=${ENTRYPOINT}" >> $GITHUB_OUTPUT
fi
Expand Down

0 comments on commit e539612

Please sign in to comment.