diff --git a/cmd/thv-operator/main.go b/cmd/thv-operator/main.go index 2795f2c94..4535f9a08 100644 --- a/cmd/thv-operator/main.go +++ b/cmd/thv-operator/main.go @@ -100,8 +100,9 @@ func main() { os.Exit(1) } + podNamespace, _ := os.LookupEnv("POD_NAMESPACE") // Set up telemetry service - only runs when elected as leader - telemetryService := telemetry.NewService(mgr.GetClient(), "") + telemetryService := telemetry.NewService(mgr.GetClient(), podNamespace) if err := mgr.Add(&telemetry.LeaderTelemetryRunnable{ TelemetryService: telemetryService, }); err != nil { diff --git a/deploy/charts/operator/Chart.yaml b/deploy/charts/operator/Chart.yaml index 864c27cb2..a90d302ad 100644 --- a/deploy/charts/operator/Chart.yaml +++ b/deploy/charts/operator/Chart.yaml @@ -2,5 +2,5 @@ apiVersion: v2 name: toolhive-operator description: A Helm chart for deploying the ToolHive Operator into Kubernetes. type: application -version: 0.2.18 +version: 0.2.19 appVersion: "0.3.5" diff --git a/deploy/charts/operator/README.md b/deploy/charts/operator/README.md index 92e9b1f8f..cebb9a44c 100644 --- a/deploy/charts/operator/README.md +++ b/deploy/charts/operator/README.md @@ -1,7 +1,7 @@ # ToolHive Operator Helm Chart -![Version: 0.2.18](https://img.shields.io/badge/Version-0.2.18-informational?style=flat-square) +![Version: 0.2.19](https://img.shields.io/badge/Version-0.2.19-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) A Helm chart for deploying the ToolHive Operator into Kubernetes. diff --git a/deploy/charts/operator/templates/deployment.yaml b/deploy/charts/operator/templates/deployment.yaml index 069301edd..7f1fa171d 100644 --- a/deploy/charts/operator/templates/deployment.yaml +++ b/deploy/charts/operator/templates/deployment.yaml @@ -46,6 +46,10 @@ spec: # Always use structured JSON logs in Kubernetes (not configurable) - name: UNSTRUCTURED_LOGS value: "false" + - name: POD_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace - name: ENABLE_EXPERIMENTAL_FEATURES value: {{ .Values.operator.features.experimental | quote }} {{- if eq .Values.operator.rbac.scope "namespace" }}