Skip to content

Commit d1fc706

Browse files
Merge pull request #560 from averdagu/feat/use-dns-get-lib-common
Use dns cluster info from lib common get function
2 parents ff87fed + db8d5f9 commit d1fc706

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pkg/metricstorage/dashboard_datasource.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package metricstorage
1919
import (
2020
"context"
2121

22+
"github.com/openstack-k8s-operators/lib-common/modules/common/clusterdns"
2223
telemetryv1 "github.com/openstack-k8s-operators/telemetry-operator/api/v1beta1"
2324
corev1 "k8s.io/api/core/v1"
2425
"k8s.io/apimachinery/pkg/types"
@@ -29,6 +30,7 @@ func DashboardDatasourceData(ctx context.Context, c client.Client, instance *tel
2930

3031
scheme := "http"
3132
certText := ""
33+
dnsDomain := clusterdns.GetDNSClusterDomain()
3234
if instance.Spec.PrometheusTLS.Enabled() {
3335
scheme = "https"
3436
namespacedName := types.NamespacedName{
@@ -55,6 +57,6 @@ spec:
5557
plugin:
5658
kind: "PrometheusDatasource"
5759
spec:
58-
direct_url: "` + scheme + `://metric-storage-prometheus.` + instance.Namespace + `.svc.cluster.local:9090"
60+
direct_url: "` + scheme + `://metric-storage-prometheus.` + instance.Namespace + `.svc.` + dnsDomain + `:9090"
5961
`}, nil
6062
}

0 commit comments

Comments
 (0)