Skip to content

Commit 481c463

Browse files
Adding libvirt configmap creation to the helper script
Currently helper script has only support for AWS and Azure extending it to Libvirt as well. Signed-off-by: Saripalli Lavanya <[email protected]>
1 parent c3531df commit 481c463

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

scripts/cm-helpers/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ cloud provider, recommended best practices, and user-provided input.
88
### Supported Cloud Providers
99
* AWS
1010
* Azure
11+
* Libvirt
1112

1213
### Prerequisites
1314
* jq, kubectl or oc installed

scripts/cm-helpers/pp-cm-helper.sh

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ aws_optional=("PODVM_AMI_ID")
4747
azure_vars=("AZURE_INSTANCE_SIZE" "AZURE_INSTANCE_SIZES" "AZURE_SUBNET_ID" "AZURE_NSG_ID" "AZURE_REGION" "AZURE_RESOURCE_GROUP")
4848
azure_optional=("AZURE_IMAGE_ID")
4949

50+
libvirt_vars=("LIBVIRT_POOL" "LIBVIRT_VOL_NAME" "LIBVIRT_DIR_NAME")
51+
libvirt_optional=("LIBVIRT_IMAGE_ID")
5052

5153
#### Functions
5254

@@ -160,6 +162,11 @@ function getLocalDefaults() {
160162
AZURE_INSTANCE_SIZE=${AZURE_INSTANCE_SIZE:-${AZURE_INSTANCE_SIZE_default}}
161163
[[ "${DISABLECVM}" == true ]] && AZURE_INSTANCE_SIZES=${AZURE_INSTANCE_SIZES:-Standard_B2als_v2,Standard_D2as_v5,Standard_D4as_v5,Standard_D2ads_v5}
162164
#AZURE_IMAGE_ID=${AZURE_IMAGE_ID}
165+
166+
# libvirt
167+
LIBVIRT_POOL=${LIBVIRT_POOL:-default}
168+
LIBVIRT_VOL_NAME=${LIBVIRT_VOL_NAME:-default}
169+
LIBVIRT_DIR_NAME=${LIBVIRT_DIR_NAME:-default}
163170
}
164171

165172
function userVerification() {
@@ -174,6 +181,10 @@ function userVerification() {
174181
verifyAndSetVars "${azure_vars[@]}"
175182
verifyAndSetVars "${azure_optional[@]}"
176183
;;
184+
"libvirt")
185+
verifyAndSetVars "${libvirt_vars[@]}"
186+
verifyAndSetVars "${libvirt_optional[@]}"
187+
;;
177188
*)
178189
error_exit "Invalid provider";;
179190
esac
@@ -227,7 +238,11 @@ function initialization() {
227238

228239
initialization
229240

230-
getIMDSDefaults
241+
if [ "$cld" != "libvirt" ]; then
242+
getIMDSDefaults
243+
else
244+
echo "Provider is libvirt, skipping getIMDSDefaults."
245+
fi
231246

232247
getLocalDefaults
233248

0 commit comments

Comments
 (0)