Skip to content

Commit

Permalink
Cinder: Fix cinderVolumes changes
Browse files Browse the repository at this point in the history
A regression was introduced on the handling of the `cinderVolumes` on
commit 4930eed.

The current code is not able to remove entries from the `cinderVolumes`
section so backends cannot be removed and they cannot be renamed.

When we try to remove a volume backend, the volume remains in the
existing `Cinder` CR.  And when we try to rename a volume backend, we
end up with 2 backends in the `Cinder` CR, one with the old name and one
with the new name.
  • Loading branch information
Akrog committed Jun 19, 2024
1 parent b89dec8 commit ede5a06
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pkg/openstack/cinder.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,8 @@ func ReconcileCinder(ctx context.Context, instance *corev1beta1.OpenStackControl
return errors.New("default Cinder Volume images is unset")
}

if cinder.Spec.CinderVolumes == nil {
cinder.Spec.CinderVolumes = make(map[string]cinderv1.CinderVolumeTemplate)
}
// Discard old list of volume services and rebuild it
cinder.Spec.CinderVolumes = make(map[string]cinderv1.CinderVolumeTemplate)

for name, volume := range instance.Spec.Cinder.Template.CinderVolumes {
cinderCore := cinderv1.CinderVolumeTemplate{}
Expand Down

0 comments on commit ede5a06

Please sign in to comment.