Skip to content

Introduce node-ip for prepare.sh script#772

Open
byteocean wants to merge 1 commit intomainfrom
feat/node-ip
Open

Introduce node-ip for prepare.sh script#772
byteocean wants to merge 1 commit intomainfrom
feat/node-ip

Conversation

@byteocean
Copy link
Copy Markdown
Contributor

@byteocean byteocean commented Mar 31, 2026

Add one extra starting flag to specify the node IP used to parse for the underlaying address prefix.

background: In some cases, loopback interface has two IPv6 addresses. The current prepare script always takes the first one for parsing. It helps in deployment to overwrite this behaviour by specifying the node IPv6 address.

OPT_ALLOW_ULA=true
;;
--node-ip)
shift
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Not a bash getopt expert, but why is there only this shift and not for all of the arguments?

conf_ipv6="$OPT_NODE_IP"
else
conf_ipv6="$(get_ipv6)"
fi
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is a good candidate for bash parameter expansion ${parameter:−word}

Untested, but this should be it:

conf_ipv6=${OPT_NODE_IP:-$(get_ipv6)}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants