From cd9bc7bdc52482bdedfcff3b3504c912e313750f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20G=C3=B3mez?= Date: Thu, 21 Dec 2017 16:52:27 +0100 Subject: [PATCH] Add PostgreSQL pod name Scalyr sidecar environment (#194) This will allow the Scalyr image to add a custom attribute to shipped log entries that notes the name of the originating pod. --- pkg/cluster/k8sres.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkg/cluster/k8sres.go b/pkg/cluster/k8sres.go index b3da874ca..f59f8bcf0 100644 --- a/pkg/cluster/k8sres.go +++ b/pkg/cluster/k8sres.go @@ -445,6 +445,15 @@ func (c *Cluster) generatePodTemplate( Resources: *resourceRequirementsScalyrSidecar, VolumeMounts: volumeMounts, Env: []v1.EnvVar{ + { + Name: "POD_NAME", + ValueFrom: &v1.EnvVarSource{ + FieldRef: &v1.ObjectFieldSelector{ + APIVersion: "v1", + FieldPath: "metadata.name", + }, + }, + }, { Name: "SCALYR_API_KEY", Value: c.OpConfig.ScalyrAPIKey,