Skip to content

Commit f522417

Browse files
committed
Test IPAM and CAPM3 changes together because tests don't pass alone due to namespace name change
Signed-off-by: peppi-lotta <[email protected]>
1 parent bc435b3 commit f522417

File tree

3 files changed

+22
-7
lines changed

3 files changed

+22
-7
lines changed

03_launch_mgmt_cluster.sh

+15-6
Original file line numberDiff line numberDiff line change
@@ -268,10 +268,10 @@ function apply_bm_hosts() {
268268
function update_capm3_imports(){
269269
pushd "${CAPM3PATH}"
270270

271-
make kustomize
272-
./hack/tools/bin/kustomize build "${IPAMPATH}/config/default" > config/ipam/metal3-ipam-components.yaml
271+
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"
273272

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"
273+
make kustomize
274+
./hack/tools/bin/kustomize build "${IPAMPATH}/config/default" > ~/ipam-metal3/v1.0.0/ipam-components.yaml
275275
popd
276276
}
277277

@@ -302,10 +302,10 @@ function update_component_image(){
302302
export MANIFEST_TAG="${TMP_IMAGE_TAG}"
303303
make set-manifest-image
304304
;;
305-
"IPAM")
305+
"IPAM")
306306
export MANIFEST_IMG_IPAM="${REGISTRY}/localimages/$TMP_IMAGE_NAME"
307307
export MANIFEST_TAG_IPAM="$TMP_IMAGE_TAG"
308-
make set-manifest-image-ipam
308+
##make set-manifest-image-ipam
309309
;;
310310
"Ironic")
311311
export MANIFEST_IMG="${REGISTRY}/localimages/${TMP_IMAGE_NAME}"
@@ -339,6 +339,15 @@ function patch_clusterctl(){
339339
mkdir -p "${CAPI_CONFIG_FOLDER}"
340340
touch "${CAPI_CONFIG_FOLDER}"/clusterctl.yaml
341341

342+
cat << EOF >> "${CAPI_CONFIG_FOLDER}"/clusterctl.yaml
343+
providers:
344+
- name: metal3
345+
url: file:///home/test/ipam-metal3/v1.0.0/ipam-components.yaml
346+
type: IPAMProvider
347+
EOF
348+
349+
350+
342351
# At this point the images variables have been updated with update_images
343352
# Reflect the change in components files
344353
if [ -n "${CAPM3_LOCAL_IMAGE:-}" ]; then
@@ -387,7 +396,7 @@ function launch_cluster_api_provider_metal3() {
387396

388397
# shellcheck disable=SC2153
389398
clusterctl init --core cluster-api:"${CAPIRELEASE}" --bootstrap kubeadm:"${CAPIRELEASE}" \
390-
--control-plane kubeadm:"${CAPIRELEASE}" --infrastructure=metal3:"${CAPM3RELEASE}" -v5
399+
--control-plane kubeadm:"${CAPIRELEASE}" --infrastructure=metal3:"${CAPM3RELEASE}" -v5 --ipam metal3
391400

392401
if [ "${CAPM3_RUN_LOCAL}" == true ]; then
393402
touch capm3.out.log

config_example.sh

+6
Original file line numberDiff line numberDiff line change
@@ -206,3 +206,9 @@
206206

207207
# Uncomment the line below to build ironic-image from source
208208
# export IRONIC_FROM_SOURCE="true"
209+
210+
export CAPM3REPO="https://github.com/Nordix/cluster-api-provider-metal3"
211+
export CAPM3BRANCH="peppi-lotta/change-IPAM-namespace"
212+
213+
export IPAMREPO="https://github.com/Nordix/metal3-ipam/"
214+
export IPAMBRANCH="peppi-lotta/make-ipam-a-provider-for-capi"

tests/roles/run_tests/tasks/move.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
kubeconfig: "/tmp/kubeconfig-{{ CLUSTER_NAME }}.yaml"
9797

9898
- name: Initialize Provider component in target cluster
99-
shell: "clusterctl init --kubeconfig /tmp/kubeconfig-{{ CLUSTER_NAME }}.yaml --core cluster-api:{{ CAPIRELEASE }} --bootstrap kubeadm:{{ CAPIRELEASE }} --control-plane kubeadm:{{ CAPIRELEASE }} --infrastructure metal3:{{ CAPM3RELEASE }} -v 5"
99+
shell: "clusterctl init --kubeconfig /tmp/kubeconfig-{{ CLUSTER_NAME }}.yaml --core cluster-api:{{ CAPIRELEASE }} --bootstrap kubeadm:{{ CAPIRELEASE }} --control-plane kubeadm:{{ CAPIRELEASE }} --infrastructure metal3:{{ CAPM3RELEASE }} -v 5 --ipam metal3"
100100

101101
# Check for cert-manager pods on the target cluster
102102
- name: Check if cert-manager pods in running state

0 commit comments

Comments
 (0)