Skip to content

Commit

Permalink
Use storagemgmt network by default if defined
Browse files Browse the repository at this point in the history
Swift uses the storage network currently, but the correct network should
be the storagemgmt one. This fix prefers the storagemgmt and falls back
to storage to prevent failures in already deployed environments.
  • Loading branch information
cschwede committed Oct 16, 2024
1 parent 1683f22 commit 5a34107
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions controllers/swiftstorage_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -343,9 +343,15 @@ func (r *SwiftStorageReconciler) Reconcile(ctx context.Context, req ctrl.Request
for _, swiftPod := range podList.Items {
dnsIP := ""
if len(instance.Spec.NetworkAttachments) > 0 {
dnsIP, err = getPodIPInNetwork(swiftPod, instance.Namespace, "storage")
dnsIP, err = getPodIPInNetwork(swiftPod, instance.Namespace, "storagemgmt")

if err != nil {
return ctrl.Result{}, err
previousErr := err
dnsIP, err = getPodIPInNetwork(swiftPod, instance.Namespace, "storage")
if err != nil {
err = errors.Join(previousErr, err)
return ctrl.Result{}, err
}
}
}

Expand Down

0 comments on commit 5a34107

Please sign in to comment.