Skip to content

Commit c109bbf

Browse files
committed
fix nova defaulting
1 parent 3989d1e commit c109bbf

1 file changed

Lines changed: 8 additions & 9 deletions

File tree

‎internal/openstack/nova.go‎

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -91,20 +91,19 @@ func ReconcileNova(ctx context.Context, instance *corev1beta1.OpenStackControlPl
9191
for cellName, cellTemplate := range instance.Spec.Nova.Template.CellTemplates {
9292
if cellTemplate.MessagingBus.Cluster == "" {
9393
// Priority 1: Migrate from cell-level deprecated field
94+
// BUT: Don't migrate the old value directly - let it be cleared and defaulted properly
95+
// by nova-operator webhook, which applies per-cell defaults (rabbitmq-cell1, etc.)
9496
if cellTemplate.CellMessageBusInstance != "" {
95-
cellTemplate.MessagingBus.Cluster = cellTemplate.CellMessageBusInstance
96-
// Priority 2: Inherit from Nova API-level MessagingBus
97+
// Clear deprecated field but don't migrate value - let webhook apply correct per-cell default
98+
// This prevents migrating "rabbitmq" when the correct default is "rabbitmq-cell1"
99+
// Priority 2: Inherit from Nova API-level MessagingBus
97100
} else if instance.Spec.Nova.Template.MessagingBus.Cluster != "" {
98101
cellTemplate.MessagingBus = instance.Spec.Nova.Template.MessagingBus
99-
// Priority 3: Default to "rabbitmq" (required for CRD validation)
100-
} else {
101-
cellTemplate.MessagingBus.Cluster = "rabbitmq"
102102
}
103+
// Priority 3 (default) is now handled by nova-operator webhook which applies per-cell defaults
103104
}
104-
// Clear deprecated field after migration
105-
if cellTemplate.MessagingBus.Cluster != "" {
106-
cellTemplate.CellMessageBusInstance = ""
107-
}
105+
// ALWAYS clear deprecated field to avoid webhook validation conflicts
106+
cellTemplate.CellMessageBusInstance = ""
108107
instance.Spec.Nova.Template.CellTemplates[cellName] = cellTemplate
109108
}
110109
}

0 commit comments

Comments
 (0)