From c4ec40eca8a41c75e8dafd5fb0f38bbff7c55dc5 Mon Sep 17 00:00:00 2001 From: Brad Hoekstra Date: Fri, 21 Sep 2018 16:26:37 -0400 Subject: [PATCH] Update comment to reflect the new logic --- pkg/kubelet/kubelet_pods.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/kubelet/kubelet_pods.go b/pkg/kubelet/kubelet_pods.go index 9ff9cab6a27..d77c945712c 100644 --- a/pkg/kubelet/kubelet_pods.go +++ b/pkg/kubelet/kubelet_pods.go @@ -514,8 +514,10 @@ func (kl *Kubelet) getServiceEnvVarMap(ns string, enableServiceLinks *bool) (map } serviceName := service.Name - // for the case whether the master service namespace is the namespace the pod - // is in, the pod should receive all the services in the namespace. + // We always want to add environment variabled for master services + // from the master service namespace, even if enableServiceLinks is false. + // We also add enviroment variables for other services in the same + // namespace, if enableServiceLinks is true. if service.Namespace == kl.masterServiceNamespace && masterServices.Has(serviceName) { if _, exists := serviceMap[serviceName]; !exists { serviceMap[serviceName] = service