Skip to content

Commit

Permalink
Fix NetworkAttachments on Cinder Volume
Browse files Browse the repository at this point in the history
When we deploy multiple cinder volume backends with network attachments
the reconciliation loop is constantly getting called.

This issue happens because each of the cindervolume objects ends up with
the IP addresses of the network attachments of all the different
backends as the labels that these services are the same.

This patch adds a new label with the backend name so that the network
attachments are not merged.

Before the patch we would see both IP Addresses:

NAME                         NETWORKATTACHMENTS                                                                                  STATUS   MESSAGE
cinder-volume-lvm-iscsi      {"openshift-sdn":["10.217.1.74","10.217.1.72"],"openstack/storage":["172.18.0.32","172.18.0.30"]}   True     Setup complete
cinder-volume-lvm-nvme-tcp   {"openshift-sdn":["10.217.1.74","10.217.1.76"],"openstack/storage":["172.18.0.32","172.18.0.30"]}   True     Setup complete

After the patch we would see:

NAME                         NETWORKATTACHMENTS                                                       STATUS   MESSAGE
cinder-volume-lvm-iscsi      {"openshift-sdn":["10.217.0.211"],"openstack/storage":["172.18.0.32"]}   True     Setup complete
cinder-volume-lvm-nvme-tcp   {"openshift-sdn":["10.217.0.210"],"openstack/storage":["172.18.0.30"]}   True     Setup complete
  • Loading branch information
Akrog committed Oct 3, 2023
1 parent f8b2836 commit 53d5a6e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions controllers/cindervolume_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ func (r *CinderVolumeReconciler) reconcileNormal(ctx context.Context, instance *
serviceLabels := map[string]string{
common.AppSelector: cinder.ServiceName,
common.ComponentSelector: cindervolume.Component,
cindervolume.Backend: instance.Name[len(cindervolume.Component)+1:],
}

//
Expand Down
1 change: 1 addition & 0 deletions pkg/cindervolume/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ package cindervolume
const (
// Component -
Component = "cinder-volume"
Backend = "backend"
)

0 comments on commit 53d5a6e

Please sign in to comment.