-
Notifications
You must be signed in to change notification settings - Fork 3
osp_verification: purge bogus Machines and harden LB suite cleanup #42
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
Merged
openshift-merge-bot
merged 1 commit into
main
from
fix/osp-verification-bogus-lb-hygiene
Sep 24, 2026
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
90 changes: 90 additions & 0 deletions
90
collection/stages/roles/openstack_test/tasks/cleanup_bogus_machines.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,90 @@ | ||
| --- | ||
| # Purge leftover bogus-* MachineSets/Machines before openstack_test. | ||
| # Pairs with openstack-test bz_2073398 cleanup; suite-level hygiene if that It left | ||
| # stuck objects that poison later Machine / MachineSet / ProviderSpec specs. | ||
| # After delete, wait until gone; fail if leftovers remain so openstack_test does not start dirty. | ||
| - name: List bogus MachineSets in openshift-machine-api | ||
| ansible.builtin.shell: | | ||
| set -o pipefail | ||
| oc get machineset -n openshift-machine-api -o name 2>/dev/null \ | ||
| | grep -E 'bogus-' || true | ||
| environment: | ||
| KUBECONFIG: "{{ kubeconfig }}" | ||
| register: bogus_machinesets_cmd | ||
| changed_when: false | ||
| failed_when: false | ||
|
|
||
| - name: List bogus Machines in openshift-machine-api | ||
| ansible.builtin.shell: | | ||
| set -o pipefail | ||
| oc get machine -n openshift-machine-api -o name 2>/dev/null \ | ||
| | grep -E 'bogus-' || true | ||
| environment: | ||
| KUBECONFIG: "{{ kubeconfig }}" | ||
| register: bogus_machines_cmd | ||
| changed_when: false | ||
| failed_when: false | ||
|
|
||
| - name: Delete leftover bogus MachineSets | ||
| ansible.builtin.command: | ||
| argv: | ||
| - oc | ||
| - delete | ||
| - "{{ item }}" | ||
| - -n | ||
| - openshift-machine-api | ||
| - --wait=false | ||
| environment: | ||
| KUBECONFIG: "{{ kubeconfig }}" | ||
| loop: "{{ bogus_machinesets_cmd.stdout_lines | default([]) }}" | ||
| loop_control: | ||
| label: "{{ item }}" | ||
| register: bogus_ms_delete | ||
| changed_when: bogus_ms_delete.rc == 0 | ||
| failed_when: false | ||
| when: bogus_machinesets_cmd.stdout_lines | default([]) | length > 0 | ||
|
|
||
| - name: Delete leftover bogus Machines | ||
| ansible.builtin.command: | ||
| argv: | ||
| - oc | ||
| - delete | ||
| - "{{ item }}" | ||
| - -n | ||
| - openshift-machine-api | ||
| - --wait=false | ||
| environment: | ||
| KUBECONFIG: "{{ kubeconfig }}" | ||
| loop: "{{ bogus_machines_cmd.stdout_lines | default([]) }}" | ||
| loop_control: | ||
| label: "{{ item }}" | ||
| register: bogus_machine_delete | ||
| changed_when: bogus_machine_delete.rc == 0 | ||
| failed_when: false | ||
| when: bogus_machines_cmd.stdout_lines | default([]) | length > 0 | ||
|
|
||
| # Deletes used --wait=false; poll until matching objects are gone so openstack_test | ||
| # does not start while bogus-* resources are still terminating. Bounded timeout. | ||
| # Fail when leftovers remain after the timeout so openstack_test cannot start dirty. | ||
| - name: Wait until bogus Machines and MachineSets are gone | ||
| ansible.builtin.shell: | | ||
| set -o pipefail | ||
| ms=$(oc get machineset -n openshift-machine-api -o name 2>/dev/null | grep -E 'bogus-' || true) | ||
| m=$(oc get machine -n openshift-machine-api -o name 2>/dev/null | grep -E 'bogus-' || true) | ||
| if [ -n "$ms" ] || [ -n "$m" ]; then | ||
| echo "bogus leftovers still present:" | ||
| printf '%s\n' "$ms" "$m" | sed '/^$/d' | ||
| exit 1 | ||
| fi | ||
| echo "no bogus Machines or MachineSets remain" | ||
| exit 0 | ||
| environment: | ||
| KUBECONFIG: "{{ kubeconfig }}" | ||
| register: bogus_gone | ||
| until: bogus_gone.rc == 0 | ||
| retries: 30 | ||
| delay: 10 | ||
| changed_when: false | ||
| when: >- | ||
| (bogus_machinesets_cmd.stdout_lines | default([]) | length > 0) | ||
| or (bogus_machines_cmd.stdout_lines | default([]) | length > 0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.