OCPBUGS-90536: openstack: Guard network resource names on os_net_id being defined#10639
OCPBUGS-90536: openstack: Guard network resource names on os_net_id being defined#10639stephenfin wants to merge 1 commit into
os_net_id being defined#10639Conversation
The 'Compute network resource names' task in common.yaml uses the os_net_id variable, which is loaded from netid.json. Since commit 7b6b3f1 (OCPBUGS-39285), netid.json is loaded conditionally via include_vars (skipped when the file doesn't exist), but the task that consumes os_net_id had no corresponding guard. This causes the UPI deprovision playbook to fail with "'os_net_id' is undefined" when netid.json is not present in the working directory. Add a 'when: os_net_id is defined' guard, consistent with the existing 'when: sym.stat.exists' guard on the 'Compute resource names' task above. Note that the deprovision playbooks (e.g. down-network.yaml) do use these network resource names, but they already handle missing resources gracefully - they list resources by tag first and use 'state: absent' for deletion. Without os_net_id the names can't be computed at all, so skipping is the only safe option. More importantly, failing hard here prevents the entire deprovision run from cleaning up resources that *can* be cleaned up (servers, security groups, etc. that use infraID from metadata.json rather than os_net_id). Signed-off-by: Stephen Finucane <stephenfin@redhat.com> Assisted-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
@stephenfin: This pull request explicitly references no jira issue. DetailsIn response to this:
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. |
📝 WalkthroughWalkthroughAdds a ChangesOpenStack UPI network name guard
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes 🚥 Pre-merge checks | ✅ 15✅ Passed checks (15 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
os_net_id being defined
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
os_net_id being definedos_net_id being defined
|
@stephenfin: This pull request references Jira Issue OCPBUGS-90536, which is valid. The bug has been moved to the POST state. 3 validation(s) were run on this bug
The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn response to this:
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. |
|
/test e2e-openstack-dualstack-upi |
|
@stephenfin: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions 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 kubernetes-sigs/prow repository. I understand the commands that are listed here. |
The
Compute network resource namestask in common.yaml uses theos_net_idvariable, which is loaded fromnetid.json. Since commit 7b6b3f1 (OCPBUGS-39285),netid.jsonis loaded conditionally viainclude_vars(skipped when the file doesn't exist), but the task that consumesos_net_idhad no corresponding guard. This causes the UPI deprovision playbook to fail with'os_net_id' is undefinedwhennetid.jsonis not present in the working directory.Add a
when: os_net_id is definedguard, consistent with the existingwhen: sym.stat.existsguard on theCompute resource namestask above.Note that the deprovision playbooks (e.g.
down-network.yaml) do use these network resource names, but they already handle missing resources gracefully - they list resources by tag first and usestate: absentfor deletion. Withoutos_net_idthe names can't be computed at all, so skipping is the only safe option. More importantly, failing hard here prevents the entire deprovision run from cleaning up resources that can be cleaned up (servers, security groups, etc. that useinfraIDfrommetadata.jsonrather thanos_net_id).Summary by CodeRabbit