Skip to content

Commit 4e87726

Browse files
committed
[OSPRH-14758] Fix controlNetworkName requires default value
So far we did not have a default value for controlNetworkName, which resulted in Designate network attachment not being found in some deployments. This patch adds a hard-coded default value for Designate network attachment in case one was not defined in the CR.
1 parent 41a7ff7 commit 4e87726

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

controllers/designate_controller.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1665,6 +1665,12 @@ func (r *DesignateReconciler) mdnsStatefulSetCreateOrUpdate(ctx context.Context,
16651665
statefulSet.Spec.NodeSelector = instance.Spec.DesignateMdns.NodeSelector
16661666
statefulSet.Spec.TopologyRef = instance.Spec.DesignateMdns.TopologyRef
16671667

1668+
networkAttachment := "designate"
1669+
if instance.Spec.DesignateNetworkAttachment != "" {
1670+
networkAttachment = instance.Spec.DesignateNetworkAttachment
1671+
}
1672+
statefulSet.Spec.ControlNetworkName = networkAttachment
1673+
16681674
err := controllerutil.SetControllerReference(instance, statefulSet, r.Scheme)
16691675
if err != nil {
16701676
return err
@@ -1749,6 +1755,12 @@ func (r *DesignateReconciler) backendbind9StatefulSetCreateOrUpdate(ctx context.
17491755
statefulSet.Spec.NodeSelector = instance.Spec.DesignateBackendbind9.NodeSelector
17501756
statefulSet.Spec.TopologyRef = instance.Spec.DesignateBackendbind9.TopologyRef
17511757

1758+
networkAttachment := "designate"
1759+
if instance.Spec.DesignateNetworkAttachment != "" {
1760+
networkAttachment = instance.Spec.DesignateNetworkAttachment
1761+
}
1762+
statefulSet.Spec.ControlNetworkName = networkAttachment
1763+
17521764
err := controllerutil.SetControllerReference(instance, statefulSet, r.Scheme)
17531765
if err != nil {
17541766
return err

0 commit comments

Comments
 (0)