Skip to content

Commit

Permalink
Merge pull request #376 from averdagu/fix/get-dns-from-libcommon
Browse files Browse the repository at this point in the history
Use dns cluster info from lib common get function
  • Loading branch information
openshift-merge-bot[bot] authored Dec 19, 2024
2 parents c8f26e3 + d406486 commit 02d4a86
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 0 additions & 4 deletions api/v1beta1/ovndbcluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ const (
// ServiceClusterType - Constant to identify Cluster services
ServiceClusterType = "cluster"

// DNSSuffix : hardcoded value on how DNSCore domain is configured
DNSSuffix = "cluster.local"
// TODO: retrieve it from environment

// Container image fall-back defaults

// OVNNBContainerImage is the fall-back container image for OVNDBCluster NB
Expand Down
5 changes: 4 additions & 1 deletion controllers/ovndbcluster_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import (

infranetworkv1 "github.com/openstack-k8s-operators/infra-operator/apis/network/v1beta1"
"github.com/openstack-k8s-operators/lib-common/modules/common"
"github.com/openstack-k8s-operators/lib-common/modules/common/clusterdns"
"github.com/openstack-k8s-operators/lib-common/modules/common/condition"
"github.com/openstack-k8s-operators/lib-common/modules/common/configmap"
"github.com/openstack-k8s-operators/lib-common/modules/common/env"
Expand Down Expand Up @@ -623,7 +624,9 @@ func (r *OVNDBClusterReconciler) reconcileNormal(ctx context.Context, instance *
if svc.Spec.ClusterIP == "None" || svc.Spec.Type == corev1.ServiceTypeLoadBalancer {
continue
}
internalDbAddress = append(internalDbAddress, fmt.Sprintf("%s:%s.%s.svc.%s:%d", scheme, svc.Name, svc.Namespace, ovnv1.DNSSuffix, svcPort))
// TODO: Watch operator.openshift.io resource once cluster domain is customizable
clusterDomain := clusterdns.GetDNSClusterDomain()
internalDbAddress = append(internalDbAddress, fmt.Sprintf("%s:%s.%s.svc.%s:%d", scheme, svc.Name, svc.Namespace, clusterDomain, svcPort))
}

// Note setting this to the singular headless service address (e.g ssl:ovsdbserver-sb...) "works" but will not
Expand Down

0 comments on commit 02d4a86

Please sign in to comment.