Skip to content

hack: redundant $? exit-code check after go run in install.sh #9001

@Ankitsinghsisodya

Description

@Ankitsinghsisodya

Problem

hack/install.sh lines 25–28 manually check the exit code of go run:

go run "$(dirname "$0")/../test/version_check/check_k8s_version.go"
if [[ $? -ne 0 ]]; then
    echo "Kubernetes version check failed. Exiting."
    exit 1
fi

set -o errexit is already active (line 19), so a non-zero exit from go run already terminates the script. The manual check is dead code that adds noise and could mislead readers into thinking set -o errexit is not active.

Proposed Fix

Remove the if [[ $? -ne 0 ]]; then … fi block and rely on set -o errexit.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

Status

Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions