Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the OSBMS scaling KUTTL test #1111

Merged

Conversation

abays
Copy link
Contributor

@abays abays commented Nov 14, 2024

Fixes for the OpenStackBaremetalSet scaling KUTTL test. Also adjusts the default RHEL image in our config samples and makes minor edits to other KUTTL tests that consider this image.

Comment on lines -35 to -52
---
# We don't know which BMH was chosen as compute-0 originally, so we use a script to
# check for the "BaremetalHostNotFound" error (as the actual error message will vary
# based on which BMH was actually deleted)
apiVersion: kuttl.dev/v1beta1
kind: TestAssert
namespaced: true
timeout: 600
commands:
- script: |
set -x
sleep 5
osbmsstate=$(oc get osbms -n openstack compute -o json | jq -r '.status.provisioningStatus.reason')
if grep -q "Please check BaremetalHost resources and re-add" <<< "$osbmsstate"; then
exit 0
else
exit 1
fi
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was unnecessary. Just checking the OSBMS status.provisioningStatus.readyCount and status.provisioningStatus.state is enough to detect the problem we are expecting.

Comment on lines -36 to -38
reason: Existing BaremetalHost "openshift-worker-0" not found for OpenStackBaremetalSet
compute. Please check BaremetalHost resources and re-add "openshift-worker-0"
to continue
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was unnecessary. Just checking the OSBMS status.provisioningStatus.readyCount and status.provisioningStatus.state is enough to detect the problem we are expecting.

Comment on lines -36 to -38
reason: Existing BaremetalHost "openshift-worker-0" not found for OpenStackBaremetalSet
compute. Please check BaremetalHost resources and re-add "openshift-worker-0"
to continue
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was unnecessary. Just checking the OSBMS status.provisioningStatus.readyCount and status.provisioningStatus.state is enough to detect the problem we are expecting.

Comment on lines -7 to +8
bmhname=$(oc get -n openstack osbms compute -o json | jq -r '.status.baremetalHosts["compute-0"].hostRef')
bmhsecretname=$(oc get bmh -n openshift-machine-api ${bmhname} -o json | jq -r '.spec.bmc.credentialsName')
oc get -n openshift-machine-api bmh ${bmhname} -o json |\
bmhname=$(oc get bmh -n openshift-machine-api -l osp-director.openstack.org/name=compute -l osp-director.openstack.org/namespace=openstack -o name | head -1)
bmhsecretname=$(oc get -n openshift-machine-api ${bmhname} -o json | jq -r '.spec.bmc.credentialsName')
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need to pick a specific host/BMH. We just need to delete one of them, and so we now just choose the first one in the list.

Copy link
Contributor

@stuggi stuggi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

Copy link
Contributor

openshift-ci bot commented Nov 19, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: abays, stuggi

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot openshift-merge-bot bot merged commit 6f23064 into openstack-k8s-operators:master Nov 19, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants