Update comment to reflect the new logic

This commit is contained in:
Brad Hoekstra 2018-09-21 16:26:37 -04:00
parent 2c5cc79eed
commit c4ec40eca8

View File

@ -514,8 +514,10 @@ func (kl *Kubelet) getServiceEnvVarMap(ns string, enableServiceLinks *bool) (map
} }
serviceName := service.Name serviceName := service.Name
// for the case whether the master service namespace is the namespace the pod // We always want to add environment variabled for master services
// is in, the pod should receive all the services in the namespace. // 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 service.Namespace == kl.masterServiceNamespace && masterServices.Has(serviceName) {
if _, exists := serviceMap[serviceName]; !exists { if _, exists := serviceMap[serviceName]; !exists {
serviceMap[serviceName] = service serviceMap[serviceName] = service