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

OCPBUGS-32425: Test for the presence of "provisioned" server #8289

Merged
merged 1 commit into from Apr 22, 2024

Conversation

derekhiggins
Copy link
Contributor

rather the the absense of lines with "provisioned". If the oc command fails the test will still evaluate to False.

Also mask failures from the second "oc get bmh" command so they wont cause the script to exit.

@derekhiggins derekhiggins changed the title Test for the presence of "provisioned" server OCPBUGS-32425: Test for the presence of "provisioned" server Apr 18, 2024
@openshift-ci-robot openshift-ci-robot added jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Apr 18, 2024
@openshift-ci-robot
Copy link
Contributor

@derekhiggins: This pull request references Jira Issue OCPBUGS-32425, which is invalid:

  • expected the bug to target the "4.16.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

In response to this:

rather the the absense of lines with "provisioned". If the oc command fails the test will still evaluate to False.

Also mask failures from the second "oc get bmh" command so they wont cause the script to exit.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@@ -15,9 +15,10 @@ while [ "$(oc get bmh -n openshift-machine-api -o name | wc -l)" -lt 1 ]; do
sleep 20
done

while [ "$(oc get bmh -n openshift-machine-api -l installer.openshift.io/role=control-plane -o json | jq '.items[].status.provisioning.state' | grep -v provisioned -c)" -gt 0 ]; do
N=$(oc get bmh -n openshift-machine-api -l installer.openshift.io/role=control-plane -o json | jq '.items[].status.provisioning.state' | wc -l)
Copy link
Member

Choose a reason for hiding this comment

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

Probably don't need all those pipes if all we want to do is grab the number of control plane hosts

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ack, I've removed the jq

@derekhiggins derekhiggins force-pushed the test-provisioned branch 2 times, most recently from 2a15f6e to 933957b Compare April 18, 2024 19:52
@derekhiggins
Copy link
Contributor Author

/retest-required

@derekhiggins
Copy link
Contributor Author

/test e2e-metal-ipi-ovn-ipv6

@honza
Copy link
Member

honza commented Apr 19, 2024

/approve

Copy link
Contributor

openshift-ci bot commented Apr 19, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: honza

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-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 19, 2024
@derekhiggins
Copy link
Contributor Author

/test e2e-metal-ipi-ovn-ipv6

1 similar comment
@derekhiggins
Copy link
Contributor Author

/test e2e-metal-ipi-ovn-ipv6

@derekhiggins
Copy link
Contributor Author

/jira refresh

@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Apr 22, 2024
@openshift-ci-robot
Copy link
Contributor

@derekhiggins: This pull request references Jira Issue OCPBUGS-32425, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.16.0) matches configured target version for branch (4.16.0)
  • bug is in the state New, which is one of the valid states (NEW, ASSIGNED, POST)

No GitHub users were found matching the public email listed for the QA contact in Jira (jhajyahy@redhat.com), skipping review request.

In response to this:

/jira refresh

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

sleep 20
done
echo "Waiting for $N masters to become provisioned"
while [ "$(oc get bmh -n openshift-machine-api -l installer.openshift.io/role=control-plane -o json | jq '.items[].status.provisioning.state' | grep provisioned -c)" -ne "$N" ]; do
Copy link
Member

Choose a reason for hiding this comment

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

I'm worried about a potential race where we catch Kubernetes with only 2 masters (3rd one just not created yet) and then keep waiting for exactly 2. Maybe change to -ge?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, (I guess you mean -lt ? )

I'll also move the sleep above so that it waits a little before trying to set the number

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, sorry, got the logic reversed in my head.

@derekhiggins derekhiggins force-pushed the test-provisioned branch 2 times, most recently from 19a24fc to 567a132 Compare April 22, 2024 09:44
@@ -10,14 +10,16 @@ until oc get baremetalhosts -n openshift-machine-api; do
sleep 20
done

while [ "$(oc get bmh -n openshift-machine-api -o name | wc -l)" -lt 1 ]; do
N="0"
while [ "$N" -eq "0" ] ; do
echo "Waiting for bmh"
Copy link
Member

Choose a reason for hiding this comment

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

nit: bonus for a more descriptive message here

rather the the absense of lines with "provisioned".
If the oc command fails the test will still evaluate to False.

Also mask failures from the second "oc get bmh" command so they
wont cause the script to exit.
@dtantsur
Copy link
Member

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Apr 22, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit e87c42a into openshift:master Apr 22, 2024
27 of 29 checks passed
@openshift-ci-robot
Copy link
Contributor

@derekhiggins: Jira Issue OCPBUGS-32425: All pull requests linked via external trackers have merged:

Jira Issue OCPBUGS-32425 has been moved to the MODIFIED state.

In response to this:

rather the the absense of lines with "provisioned". If the oc command fails the test will still evaluate to False.

Also mask failures from the second "oc get bmh" command so they wont cause the script to exit.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-merge-robot
Copy link
Contributor

Fix included in accepted release 4.16.0-0.nightly-2024-04-26-145258

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants