Skip to content

Commit

Permalink
Adding libvirt configmap creation to the helper script
Browse files Browse the repository at this point in the history
Currently helper script has only support for AWS and Azure extending it to Libvirt as well.

Signed-off-by: Saripalli Lavanya <[email protected]>
  • Loading branch information
Saripalli-lavanya committed Feb 5, 2025
1 parent c3531df commit 481c463
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
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")
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[@]}"
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

0 comments on commit 481c463

Please sign in to comment.