Skip to content

Commit

Permalink
Test IPAM and CAPM3 changes together because tests don't pass alone d…
Browse files Browse the repository at this point in the history
…ue to namespace name change

Signed-off-by: peppi-lotta <[email protected]>
  • Loading branch information
peppi-lotta committed Sep 30, 2024
1 parent bc435b3 commit 9ef6cc2
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 7 deletions.
21 changes: 15 additions & 6 deletions 03_launch_mgmt_cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -268,10 +268,10 @@ function apply_bm_hosts() {
function update_capm3_imports(){
pushd "${CAPM3PATH}"

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

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"
make kustomize
./hack/tools/bin/kustomize build "${IPAMPATH}/config/default" > "${HOME}"/ipam-metal3/v1.0.0/ipam-components.yaml
popd
}

Expand Down Expand Up @@ -302,10 +302,10 @@ function update_component_image(){
export MANIFEST_TAG="${TMP_IMAGE_TAG}"
make set-manifest-image
;;
"IPAM")
"IPAM")
export MANIFEST_IMG_IPAM="${REGISTRY}/localimages/$TMP_IMAGE_NAME"
export MANIFEST_TAG_IPAM="$TMP_IMAGE_TAG"
make set-manifest-image-ipam
##make set-manifest-image-ipam
;;
"Ironic")
export MANIFEST_IMG="${REGISTRY}/localimages/${TMP_IMAGE_NAME}"
Expand Down Expand Up @@ -339,6 +339,15 @@ function patch_clusterctl(){
mkdir -p "${CAPI_CONFIG_FOLDER}"
touch "${CAPI_CONFIG_FOLDER}"/clusterctl.yaml

cat << EOF >> "${CAPI_CONFIG_FOLDER}"/clusterctl.yaml
providers:
- name: metal3
url: file://${HOME}/ipam-metal3/v1.0.0/ipam-components.yaml
type: IPAMProvider
EOF



# At this point the images variables have been updated with update_images
# Reflect the change in components files
if [ -n "${CAPM3_LOCAL_IMAGE:-}" ]; then
Expand Down Expand Up @@ -387,7 +396,7 @@ function launch_cluster_api_provider_metal3() {

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

if [ "${CAPM3_RUN_LOCAL}" == true ]; then
touch capm3.out.log
Expand Down
6 changes: 6 additions & 0 deletions config_example.sh
Original file line number Diff line number Diff line change
Expand Up @@ -206,3 +206,9 @@

# Uncomment the line below to build ironic-image from source
# export IRONIC_FROM_SOURCE="true"

export CAPM3REPO="https://github.com/Nordix/cluster-api-provider-metal3"
export CAPM3BRANCH="peppi-lotta/change-IPAM-namespace"

export IPAMREPO="https://github.com/Nordix/metal3-ipam/"
export IPAMBRANCH="peppi-lotta/make-ipam-a-provider-for-capi"
2 changes: 1 addition & 1 deletion tests/roles/run_tests/tasks/move.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
kubeconfig: "/tmp/kubeconfig-{{ CLUSTER_NAME }}.yaml"

- name: Initialize Provider component in target cluster
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"
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"

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

0 comments on commit 9ef6cc2

Please sign in to comment.