Skip to content

shellcheck fixes part 1#1898

Open
tdomnesc wants to merge 1 commit into
openshift-metal3:masterfrom
tdomnesc:shellcheck
Open

shellcheck fixes part 1#1898
tdomnesc wants to merge 1 commit into
openshift-metal3:masterfrom
tdomnesc:shellcheck

Conversation

@tdomnesc
Copy link
Copy Markdown
Contributor

No description provided.

@openshift-ci openshift-ci Bot requested review from celebdor and sadasu May 29, 2026 11:54
Copy link
Copy Markdown
Member

@zaneb zaneb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"part 1 of 754" 😆
/approve

# overwrite an existing installation of the golang version, though,
# so check if we have a yq before installing.
if ! which yq 2>&1 >/dev/null; then
if ! which yq >/dev/null 2>&1; then
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: if you do

Suggested change
if ! which yq >/dev/null 2>&1; then
if ! which yq &>/dev/null; then

then nobody ever has to think about whether this is the right order or not (it is now) again.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First form is more visible and and is everywhere in the repo, let's leave it like this.

Comment thread sanitychecks.sh
AVAIL=$(df -h --output=avail -B 1G "$WORKING_DIR" | tail -n 1)

if (( $AVAIL < $MIN_SPACE_REQUIRED )); then
if (( "$AVAIL" < "$MIN_SPACE_REQUIRED" )); then
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (( "$AVAIL" < "$MIN_SPACE_REQUIRED" )); then
if (( AVAIL < MIN_SPACE_REQUIRED )); then

Comment thread utils.sh
sed -i -e "s%${IMAGE}%${IMAGE_MIRRORED}%g" "$ASSET_NEW"
done
done
done < <(find "${ASSETS_EXTRA_FOLDER}" \( -name \*.yml -or -name \*.yaml \) -print0)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yowza

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean here?

Comment thread utils.sh
role="$3"

for ((idx=$start_idx;idx<$(($1 + $start_idx));idx++)); do
for ((idx=start_idx;idx<$((num_hosts + start_idx));idx++)); do
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
for ((idx=start_idx;idx<$((num_hosts + start_idx));idx++)); do
for ((idx=start_idx; idx < num_hosts + start_idx; idx++)); do

Comment thread utils.sh
EOF
for ((idx=0;idx<$(($NUM_MASTERS));idx++)); do
hostname="$(printf $MASTER_HOSTNAME_FORMAT ${idx})"
for ((idx=0;idx<$((NUM_MASTERS));idx++)); do
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
for ((idx=0;idx<$((NUM_MASTERS));idx++)); do
for ((idx=0; idx < NUM_MASTERS; idx++)); do

@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented May 29, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: zaneb

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants