Skip to content

Commit

Permalink
Merge pull request #560 from averdagu/feat/use-dns-get-lib-common
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 16, 2024
2 parents ff87fed + db8d5f9 commit d1fc706
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/metricstorage/dashboard_datasource.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package metricstorage
import (
"context"

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

scheme := "http"
certText := ""
dnsDomain := clusterdns.GetDNSClusterDomain()
if instance.Spec.PrometheusTLS.Enabled() {
scheme = "https"
namespacedName := types.NamespacedName{
Expand All @@ -55,6 +57,6 @@ spec:
plugin:
kind: "PrometheusDatasource"
spec:
direct_url: "` + scheme + `://metric-storage-prometheus.` + instance.Namespace + `.svc.cluster.local:9090"
direct_url: "` + scheme + `://metric-storage-prometheus.` + instance.Namespace + `.svc.` + dnsDomain + `:9090"
`}, nil
}

0 comments on commit d1fc706

Please sign in to comment.