@@ -48,6 +48,8 @@ type DNSDetails struct {
4848 Hostnames map[string]map[infranetworkv1.NetNameStr]string
4949 // AllIPs holds a map of all IP addresses per hostname.
5050 AllIPs map[string]map[infranetworkv1.NetNameStr]string
51+ // DNSDataLabelSelectorValue to match configmaps dnsmasqhosts label
52+ DNSDataLabelSelectorValue string
5153}
5254
5355// checkDNSService checks if DNS is configured and ready
@@ -78,6 +80,8 @@ func checkDNSService(ctx context.Context, helper *helper.Helper,
7880 }
7981 dnsDetails.ClusterAddresses = dnsmasqList.Items[0].Status.DNSClusterAddresses
8082 dnsDetails.ServerAddresses = dnsmasqList.Items[0].Status.DNSAddresses
83+ dnsDetails.DNSDataLabelSelectorValue = dnsmasqList.Items[0].Spec.DNSDataLabelSelectorValue
84+
8185 return nil
8286}
8387
@@ -152,9 +156,7 @@ func createOrPatchDNSData(ctx context.Context, helper *helper.Helper,
152156 }
153157 _, err := controllerutil.CreateOrPatch(ctx, helper.GetClient(), dnsData, func() error {
154158 dnsData.Spec.Hosts = allDNSRecords
155- // TODO (rabi) DNSDataLabelSelectorValue can probably be
156- // used from dnsmasq(?)
157- dnsData.Spec.DNSDataLabelSelectorValue = "dnsdata"
159+ dnsData.Spec.DNSDataLabelSelectorValue = dnsDetails.DNSDataLabelSelectorValue
158160 // Set controller reference to the DataPlaneNode object
159161 err := controllerutil.SetControllerReference(
160162 helper.GetBeforeObject(), dnsData, helper.GetScheme())
0 commit comments