Skip to content

Commit

Permalink
refactor: use regex for architecture check to improve readability and…
Browse files Browse the repository at this point in the history
… satisfy reviewdog
  • Loading branch information
ptankov committed Dec 11, 2024
1 parent 592bbdc commit 15d6819
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion e2e-tests/functions
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ logs_dir=$(realpath $test_dir/../logs || :)
if archs=$(kubectl get nodes -o jsonpath='{range .items[*]}{.status.nodeInfo.architecture}{" "}{end}'); then
first_arch=$(echo $archs | awk '{print $1}')

if [[ "$first_arch" == "amd64" || "$first_arch" == "arm64" ]]; then
if [[ $first_arch =~ ^(amd64|arm64)$ ]]; then
for arch in $archs; do
if [[ "$arch" != "$first_arch" ]]; then
echo "All nodes in the cluster must be equal to the 1-st one: $first_arch !"
Expand Down

0 comments on commit 15d6819

Please sign in to comment.