Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix setup.sh to work when .nat_interface doesn't exist #78

Merged
merged 1 commit into from
Apr 12, 2021

Conversation

nshalman
Copy link
Member

@nshalman nshalman commented Apr 12, 2021

Description

This is a follow-up to #76 which introduced a failure:

provisioner: ./setup.sh: line 117: NAT_INTERFACE: unbound variable

Why is this needed

Unbreak setup.sh when used by Vagrant

Fixes #77

How Has This Been Tested?

I used the following simple test case. It works now that the variable is declared first, but still breaks as reported without the fix.

#!/bin/bash
set -eu
NAT_INTERFACE=""
if [ -r .nat_interface ]; then
	NAT_INTERFACE=$(cat .nat_interface)
fi
if [ -n "$NAT_INTERFACE" ] && ip addr show "$NAT_INTERFACE" &>/dev/null; then
	echo "$NAT_INTERFACE"
fi

How are existing users impacted? What migration steps/scripts do we need?

Vagrant users are currently broken as reported in the community Slack.

Checklist:

I have:

  • updated the documentation and/or roadmap (if required)
  • added unit or e2e tests
  • provided instructions on how to upgrade

Signed-off-by: Nahum Shalman <nshalman@equinix.com>
@nshalman nshalman self-assigned this Apr 12, 2021
@nshalman nshalman added the ready-to-merge Signal to Mergify to merge the PR. label Apr 12, 2021
@mergify mergify bot merged commit 661855e into tinkerbell:master Apr 12, 2021
@nshalman nshalman deleted the fix-nat-setup branch April 12, 2021 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge Signal to Mergify to merge the PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

provisioner: ./setup.sh: line 117: NAT_INTERFACE: unbound variable
3 participants