Skip to content

Commit

Permalink
Merge pull request whoan#89 from whoan/fix-regex-to-get-service-name
Browse files Browse the repository at this point in the history
Fix regex to get service nae
  • Loading branch information
whoan authored Jan 30, 2021
2 parents 674ce8e + 823202b commit a7389e9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ _set_variables() {
_get_service_name_by_image_name() {
local image_name
image_name="${1:?I need an image_name}"
grep -Po "(?<=services@)[^@]+(?=@image=.*\W${image_name}\W)" "$parsed_yaml" ||
# regex info: https://github.com/distribution/distribution/blob/main/reference/regexp.go
grep -Po "(?<=services@)[^@]+(?=@image=\"${image_name}(?![[:alnum:]-._]))" "$parsed_yaml" ||
{ echo "Failed to get service name" >&2 && false; }
}

Expand Down

0 comments on commit a7389e9

Please sign in to comment.