@@ -258,23 +258,33 @@ function apply_bm_hosts() {
258
258
popd
259
259
}
260
260
261
- # --------------------------
262
- # CAPM3 deployment functions
263
- # --------------------------
261
+ # -----------------------------
262
+ # Create loacal IPAM release for testing
263
+ # -----------------------------
264
+ function create_local_ipam_version(){
265
+
266
+ mkdir -p " ${HOME} " /ipam-metal3/v1.0.0/
267
+ git init " ${HOME} " /ipam-metal3
268
+
269
+ cat << EOF > "${HOME} "/ipam-metal3/v1.0.0/metadata.yaml
270
+ apiVersion: clusterctl.cluster.x-k8s.io/v1alpha3
271
+ kind: Metadata
272
+ releaseSeries:
273
+ - major: 1
274
+ minor: 0
275
+ contract: v1beta1
276
+ EOF
264
277
265
- #
266
- # Update the imports for the CAPM3 deployment files
267
- #
268
- function update_capm3_imports(){
269
- pushd " ${CAPM3PATH} "
278
+ sed -i -e " s#quay.io/metal3-io/ip-address-manager:main#docker.io/estpeppilotta/ipam-provider-metal3-test:latest#" " ${IPAMPATH} /config/default/manager_image_patch.yaml"
270
279
271
280
make kustomize
272
- ./hack/tools/bin/kustomize build " ${IPAMPATH} /config/default" > config/ipam/metal3-ipam-components.yaml
273
-
274
- sed -i -e " s#https://github.com/metal3-io/ip-address-manager/releases/download/v.*/ipam-components.yaml#metal3-ipam-components.yaml#" " config/ipam/kustomization.yaml"
281
+ ./hack/tools/bin/kustomize build " ${IPAMPATH} /config/default" > " ${HOME} " /ipam-metal3/v1.0.0/ipam-components.yaml
275
282
popd
276
283
}
277
284
285
+ # --------------------------
286
+ # CAPM3 deployment functions
287
+ # --------------------------
278
288
#
279
289
# Update the CAPM3 and BMO manifests to use local images as defined in variables
280
290
#
@@ -302,11 +312,6 @@ function update_component_image(){
302
312
export MANIFEST_TAG=" ${TMP_IMAGE_TAG} "
303
313
make set-manifest-image
304
314
;;
305
- " IPAM" )
306
- export MANIFEST_IMG_IPAM=" ${REGISTRY} /localimages/$TMP_IMAGE_NAME "
307
- export MANIFEST_TAG_IPAM=" $TMP_IMAGE_TAG "
308
- make set-manifest-image-ipam
309
- ;;
310
315
" Ironic" )
311
316
export MANIFEST_IMG=" ${REGISTRY} /localimages/${TMP_IMAGE_NAME} "
312
317
export MANIFEST_TAG=" ${TMP_IMAGE_TAG} "
@@ -339,6 +344,15 @@ function patch_clusterctl(){
339
344
mkdir -p " ${CAPI_CONFIG_FOLDER} "
340
345
touch " ${CAPI_CONFIG_FOLDER} " /clusterctl.yaml
341
346
347
+ cat << EOF >> "${CAPI_CONFIG_FOLDER} "/clusterctl.yaml
348
+ providers:
349
+ - name: metal3
350
+ url: file://${HOME} /ipam-metal3/v1.0.0/ipam-components.yaml
351
+ type: IPAMProvider
352
+ EOF
353
+
354
+
355
+
342
356
# At this point the images variables have been updated with update_images
343
357
# Reflect the change in components files
344
358
if [ -n " ${CAPM3_LOCAL_IMAGE:- } " ]; then
@@ -353,7 +367,8 @@ function patch_clusterctl(){
353
367
update_component_image IPAM " ${IPAM_IMAGE} "
354
368
fi
355
369
356
- update_capm3_imports
370
+ pushd " ${CAPM3PATH} "
371
+ create_local_ipam_version
357
372
make release-manifests
358
373
359
374
rm -rf " ${CAPI_CONFIG_FOLDER} " /overrides/infrastructure-metal3/" ${CAPM3RELEASE} "
@@ -387,7 +402,7 @@ function launch_cluster_api_provider_metal3() {
387
402
388
403
# shellcheck disable=SC2153
389
404
clusterctl init --core cluster-api:" ${CAPIRELEASE} " --bootstrap kubeadm:" ${CAPIRELEASE} " \
390
- --control-plane kubeadm:" ${CAPIRELEASE} " --infrastructure=metal3:" ${CAPM3RELEASE} " -v5
405
+ --control-plane kubeadm:" ${CAPIRELEASE} " --infrastructure=metal3:" ${CAPM3RELEASE} " -v5 --ipam metal3
391
406
392
407
if [ " ${CAPM3_RUN_LOCAL} " == true ]; then
393
408
touch capm3.out.log
0 commit comments