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

HIVE-2581: OpenStack e2e #2589

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions hack/e2e-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,24 @@ function wait_for_namespace {
exit 1
}

function get_osp_resources() {
local resource_path=$1

# Check if SHARED_DIR is set
if [ -z "$SHARED_DIR" ]; then
echo "Variable 'SHARED_DIR' not set."
exit 1
fi

# Check if the file exists
if [ ! -f "$1" ]; then
echo "Error: Resource file '$1' not found."
exit 1
fi

cat "$1"
}

function save_hive_logs() {
tmpf=$(mktemp)
for x in "deploy hive-controllers ${HIVE_NS}" \
Expand Down Expand Up @@ -241,6 +259,23 @@ case "${CLOUD}" in
--vsphere-network=$NETWORK_NAME \
--vsphere-vcenter=$VCENTER"
;;
"openstack")
CREDS_FILE_ARG="--creds-file=${SHARED_DIR}/clouds.yaml"
USE_MANAGED_DNS=false
BASE_DOMAIN="${BASE_DOMAIN:-shiftstack.devcluster.openshift.com }"
API_FLOATING_IP=$(get_osp_resources "${SHARED_DIR}/HIVE_FIP_API")
INGRESS_FLOATING_IP=$(get_osp_resources "${SHARED_DIR}/HIVE_FIP_INGRESS")
EXTERNAL_NETWORK=$(get_osp_resources "${SHARED_DIR}/OPENSTACK_EXTERNAL_NETWORK")
COMPUTE_FLAVOR=$(get_osp_resources "${SHARED_DIR}/OPENSTACK_COMPUTE_FLAVOR")
CONTROLPLANE_FLAVOR=$(get_osp_resources "${SHARED_DIR}/OPENSTACK_CONTROLPLANE_FLAVOR")
EXTRA_CREATE_CLUSTER_ARGS="--openstack-api-floating-ip=$API_FLOATING_IP \
--openstack-ingress-floating-ip=$INGRESS_FLOATING_IP \
--machine-network="10.0.0.0/16" \
--openstack-cloud="openstack" \
--openstack-external-network=$EXTERNAL_NETWORK \
--openstack-compute-flavor=$COMPUTE_FLAVOR \
--openstack-master-flavor=$CONTROLPLANE_FLAVOR"
;;
*)
echo "unknown cloud: ${CLOUD}"
exit 1
Expand Down
6 changes: 5 additions & 1 deletion hack/e2e-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,11 @@ if [[ $rc -ne 0 ]]; then
exit 1
fi

export CLUSTER_NAME="${CLUSTER_NAME:-hive-$(uuidgen | tr '[:upper:]' '[:lower:]')}"
if [[ "${CLOUD}" == "openstack" ]]; then
export CLUSTER_NAME=$(get_osp_resources "${SHARED_DIR}/HIVE_CLUSTER_NAME")
else
export CLUSTER_NAME="${CLUSTER_NAME:-hive-$(uuidgen | tr '[:upper:]' '[:lower:]')}"
fi

echo "Creating cluster deployment"
# - Add a bogus API URL override to validate that our unreachable controller correctly
Expand Down