Skip to content

Commit c01bfc8

Browse files
committed
Allow to rebuild the ManilaShares list
We're currently not able to trigger a shareCleanup reconciliation loop when the CR is updated and a ManilaShare entry is removed/updated. In the effort of adding the shareCleanup feature in [1], we want to be able to fix the openstack-operator code to rebuild a fresh version of the ManilaShares from the existing CR. Signed-off-by: Francesco Pantano <[email protected]>
1 parent 19b20d7 commit c01bfc8

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

pkg/openstack/manila.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,8 @@ func ReconcileManila(ctx context.Context, instance *corev1beta1.OpenStackControl
120120
return errors.New("default Manila Share images is unset")
121121
}
122122

123-
if manila.Spec.ManilaShares == nil {
124-
manila.Spec.ManilaShares = make(map[string]manilav1.ManilaShareTemplate)
125-
}
123+
// Discard old list of share services and rebuild it
124+
manila.Spec.ManilaShares = make(map[string]manilav1.ManilaShareTemplate)
126125

127126
for name, share := range instance.Spec.Manila.Template.ManilaShares {
128127
manilaCore := manilav1.ManilaShareTemplate{}

0 commit comments

Comments
 (0)