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

Adding libvirt provider to helper interactive script for setting peer-pods-cm #501

Merged
merged 1 commit into from
Feb 12, 2025
Merged
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
1 change: 1 addition & 0 deletions scripts/cm-helpers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ cloud provider, recommended best practices, and user-provided input.
### Supported Cloud Providers
* AWS
* Azure
* Libvirt

### Prerequisites
* jq, kubectl or oc installed
Expand Down
17 changes: 16 additions & 1 deletion scripts/cm-helpers/pp-cm-helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ aws_optional=("PODVM_AMI_ID")
azure_vars=("AZURE_INSTANCE_SIZE" "AZURE_INSTANCE_SIZES" "AZURE_SUBNET_ID" "AZURE_NSG_ID" "AZURE_REGION" "AZURE_RESOURCE_GROUP")
azure_optional=("AZURE_IMAGE_ID")

libvirt_vars=("LIBVIRT_POOL" "LIBVIRT_VOL_NAME" "LIBVIRT_DIR_NAME")
bpradipt marked this conversation as resolved.
Show resolved Hide resolved
libvirt_optional=("LIBVIRT_IMAGE_ID")

#### Functions

Expand Down Expand Up @@ -160,6 +162,11 @@ function getLocalDefaults() {
AZURE_INSTANCE_SIZE=${AZURE_INSTANCE_SIZE:-${AZURE_INSTANCE_SIZE_default}}
[[ "${DISABLECVM}" == true ]] && AZURE_INSTANCE_SIZES=${AZURE_INSTANCE_SIZES:-Standard_B2als_v2,Standard_D2as_v5,Standard_D4as_v5,Standard_D2ads_v5}
#AZURE_IMAGE_ID=${AZURE_IMAGE_ID}

# libvirt
LIBVIRT_POOL=${LIBVIRT_POOL:-default}
LIBVIRT_VOL_NAME=${LIBVIRT_VOL_NAME:-default}
LIBVIRT_DIR_NAME=${LIBVIRT_DIR_NAME:-default}
}

function userVerification() {
Expand All @@ -174,6 +181,10 @@ function userVerification() {
verifyAndSetVars "${azure_vars[@]}"
verifyAndSetVars "${azure_optional[@]}"
;;
"libvirt")
verifyAndSetVars "${libvirt_vars[@]}"
bpradipt marked this conversation as resolved.
Show resolved Hide resolved
verifyAndSetVars "${libvirt_optional[@]}"
;;
*)
error_exit "Invalid provider";;
esac
Expand Down Expand Up @@ -227,7 +238,11 @@ function initialization() {

initialization

getIMDSDefaults
if [ "$cld" != "libvirt" ]; then
getIMDSDefaults
else
echo "Provider is libvirt, skipping getIMDSDefaults."
fi

getLocalDefaults

Expand Down