Skip to content

Use network fallback loop for pod IP lookup in swiftStorage#464

Merged
openshift-merge-bot[bot] merged 1 commit intoopenstack-k8s-operators:mainfrom
cschwede:improve-ip-lookup
Apr 4, 2026
Merged

Use network fallback loop for pod IP lookup in swiftStorage#464
openshift-merge-bot[bot] merged 1 commit intoopenstack-k8s-operators:mainfrom
cschwede:improve-ip-lookup

Conversation

@cschwede
Copy link
Copy Markdown
Collaborator

@cschwede cschwede commented Apr 2, 2026

Instead of using error handling for control flow when looking up pod IPs, iterate over preferred networks (storage, storagemgmt) and return an explicit error only when no network has an IP at all.

Related: OSPRH-21545

Instead of using error handling for control flow when looking up pod
IPs, iterate over preferred networks (storage, storagemgmt) and return
an explicit error only when no network has an IP at all.

Related: OSPRH-21545
Signed-off-by: Christian Schwede <cschwede@redhat.com>
@openshift-ci openshift-ci bot requested review from dprince and stuggi April 2, 2026 12:55
@openshift-ci openshift-ci bot added the approved label Apr 2, 2026
@softwarefactory-project-zuul
Copy link
Copy Markdown

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/41cf3d3bbd76489688ac95a3d8588ee4

✔️ openstack-k8s-operators-content-provider SUCCESS in 1h 44m 13s
swift-operator-kuttl FAILURE in 38m 22s
✔️ swift-operator-tempest SUCCESS in 1h 23m 08s

if err != nil {
previousErr := err
dnsIP, err = getPodIPInNetwork(swiftPod, instance.Namespace, "storage")
for _, network := range []string{"storage", "storagemgmt"} {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@cschwede quick question here: I see we invert storage and storagemgmt in the loop compared to the previous code. Is the expectations to normally see an IP address in the storage network and eventually fallback to storagemgt?
If so, it makes sense to me the break on L448 to avoid dnsIP being overwritten in case both storage and storagemgmt are passed.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@fmount Yes, exactly. storage should be the default nowadays, storagemgmt is kept for backward compatibility.

@cschwede
Copy link
Copy Markdown
Collaborator Author

cschwede commented Apr 4, 2026

recheck

Copy link
Copy Markdown
Contributor

@fmount fmount left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Apr 4, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cschwede, fmount

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

The pull request process is described here

Details 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 8c382e6 into openstack-k8s-operators:main Apr 4, 2026
5 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