mirror of https://github.com/linkerd/linkerd2.git
Fix script argument regex (#4188)
Currently the release tag regex matches against arguments that have `edge` or `stable` as a substring. It should only match against arguments that are either `edge` or `stable`. For example, the graceful error handling is not triggered for the following: ``` ❯ bin/create-release-tag edge-20.3.3 bin/create-release-tag: line 92: release_tag: unbound variable ``` This PR fixes the regex so that the above results in graceful error handling. ``` ❯ bin/create-release-tag edge-20.3.3 Error: valid release channels: edge, stable Usage: bin/create-release-tag edge bin/create-release-tag stable 2.4.8 ```
This commit is contained in:
parent
8d64f4e135
commit
29db6c12a1
|
@ -15,7 +15,7 @@ fi
|
|||
release_channel="$1"
|
||||
|
||||
# Verify the release channel.
|
||||
release_channel_regex="(edge|stable)"
|
||||
release_channel_regex="^(edge|stable)$"
|
||||
if [[ ! $release_channel =~ $release_channel_regex ]]; then
|
||||
echo "Error: valid release channels: edge, stable"
|
||||
echo "Usage:"
|
||||
|
|
Loading…
Reference in New Issue