Skip to content

Commit

Permalink
Merge pull request #6696 from dokku/k3s-bats-arguments
Browse files Browse the repository at this point in the history
Run k3s tests with a specified server ip
  • Loading branch information
josegonzalez committed Mar 12, 2024
2 parents 92139a0 + a90c441 commit b976cc6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
1 change: 1 addition & 0 deletions .github/commands/ci-setup
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ DOKKU_DOMAIN=${DOKKU_DOMAIN:="dokku.me"}
echo "=====> set hostname"
hostname
internal_ip="$(ifconfig eth0 | grep 'inet ' | awk '{print $2}')"
echo "CI_SERVER_IP=${internal_ip}" >>"$GITHUB_ENV"
sudo hostname "$DOKKU_DOMAIN"
echo "$DOKKU_DOMAIN" | sudo tee /etc/hostname
hostname
Expand Down
20 changes: 11 additions & 9 deletions tests/unit/test_helper.bash
Original file line number Diff line number Diff line change
Expand Up @@ -655,18 +655,20 @@ install_k3s() {
assert_output_contains "Login Succeeded"

INGRESS_CLASS="${INGRESS_CLASS:-traefik}"
local args="--ingress-class $INGRESS_CLASS"
if [[ "$TAINT_SCHEDULING" == "true" ]]; then
run /bin/bash -c "dokku scheduler-k3s:initialize --ingress-class $INGRESS_CLASS --taint-scheduling"
echo "output: $output"
echo "status: $status"
assert_success
else
run /bin/bash -c "dokku scheduler-k3s:initialize --ingress-class $INGRESS_CLASS"
echo "output: $output"
echo "status: $status"
assert_success
args="$args --taint-scheduling"
fi

if [[ -n "$CI_SERVER_IP" ]]; then
args="$args --server-ip $CI_SERVER_IP"
fi

run /bin/bash -c "dokku scheduler-k3s:initialize ${args}"
echo "output: $output"
echo "status: $status"
assert_success

sleep 20
}

Expand Down

0 comments on commit b976cc6

Please sign in to comment.