From 84352a81c95b0a322f6b0d691fbd49d82fbc76b6 Mon Sep 17 00:00:00 2001 From: Urvashi Mohnani Date: Tue, 30 Aug 2022 10:34:13 -0400 Subject: Set enableServiceLinks to false in generated yaml Since podman doesn't set/use the needed service env variable, always set enableServiceLinks to false in the generated kube yaml. Signed-off-by: Urvashi Mohnani --- libpod/kube.go | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'libpod') diff --git a/libpod/kube.go b/libpod/kube.go index a0fb52973..a70782d69 100644 --- a/libpod/kube.go +++ b/libpod/kube.go @@ -468,12 +468,15 @@ func newPodObject(podName string, annotations map[string]string, initCtrs, conta CreationTimestamp: v12.Now(), Annotations: annotations, } + // Set enableServiceLinks to false as podman doesn't use the service port environment variables + enableServiceLinks := false ps := v1.PodSpec{ - Containers: containers, - Hostname: hostname, - HostNetwork: hostNetwork, - InitContainers: initCtrs, - Volumes: volumes, + Containers: containers, + Hostname: hostname, + HostNetwork: hostNetwork, + InitContainers: initCtrs, + Volumes: volumes, + EnableServiceLinks: &enableServiceLinks, } if dnsOptions != nil && (len(dnsOptions.Nameservers)+len(dnsOptions.Searches)+len(dnsOptions.Options) > 0) { ps.DNSConfig = dnsOptions -- cgit v1.2.3-54-g00ecf