summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-09-08 19:38:56 +0200
committerGitHub <noreply@github.com>2022-09-08 19:38:56 +0200
commit6d8bafe57a65970ead17a83cb1983629b3a2aedb (patch)
tree435ee20371ce34db117386cff0b7622d71be4f02
parent7e2f002b0751c2c24e9c243495cbc313d0c3c103 (diff)
parent71978b0a0c7f6a8e1a6a482b7f8dd105b371d3de (diff)
downloadpodman-6d8bafe57a65970ead17a83cb1983629b3a2aedb.tar.gz
podman-6d8bafe57a65970ead17a83cb1983629b3a2aedb.tar.bz2
podman-6d8bafe57a65970ead17a83cb1983629b3a2aedb.zip
Merge pull request #15607 from fpoirotte/main
Fix #15243 Set AutomountServiceAccountToken to false
-rw-r--r--libpod/kube.go15
-rw-r--r--test/e2e/generate_kube_test.go4
2 files changed, 13 insertions, 6 deletions
diff --git a/libpod/kube.go b/libpod/kube.go
index d4414aabd..c7aa4b57d 100644
--- a/libpod/kube.go
+++ b/libpod/kube.go
@@ -470,13 +470,16 @@ func newPodObject(podName string, annotations map[string]string, initCtrs, conta
}
// Set enableServiceLinks to false as podman doesn't use the service port environment variables
enableServiceLinks := false
+ // Set automountServiceAccountToken to false as podman doesn't use service account tokens
+ automountServiceAccountToken := false
ps := v1.PodSpec{
- Containers: containers,
- Hostname: hostname,
- HostNetwork: hostNetwork,
- InitContainers: initCtrs,
- Volumes: volumes,
- EnableServiceLinks: &enableServiceLinks,
+ Containers: containers,
+ Hostname: hostname,
+ HostNetwork: hostNetwork,
+ InitContainers: initCtrs,
+ Volumes: volumes,
+ EnableServiceLinks: &enableServiceLinks,
+ AutomountServiceAccountToken: &automountServiceAccountToken,
}
if dnsOptions != nil && (len(dnsOptions.Nameservers)+len(dnsOptions.Searches)+len(dnsOptions.Options) > 0) {
ps.DNSConfig = dnsOptions
diff --git a/test/e2e/generate_kube_test.go b/test/e2e/generate_kube_test.go
index a4cbf64e0..39acff6dc 100644
--- a/test/e2e/generate_kube_test.go
+++ b/test/e2e/generate_kube_test.go
@@ -73,6 +73,8 @@ var _ = Describe("Podman generate kube", func() {
Expect(pod).To(HaveField("Name", "top-pod"))
enableServiceLinks := false
Expect(pod.Spec).To(HaveField("EnableServiceLinks", &enableServiceLinks))
+ automountServiceAccountToken := false
+ Expect(pod.Spec).To(HaveField("AutomountServiceAccountToken", &automountServiceAccountToken))
numContainers := 0
for range pod.Spec.Containers {
@@ -169,6 +171,8 @@ var _ = Describe("Podman generate kube", func() {
Expect(pod.Spec).To(HaveField("HostNetwork", false))
enableServiceLinks := false
Expect(pod.Spec).To(HaveField("EnableServiceLinks", &enableServiceLinks))
+ automountServiceAccountToken := false
+ Expect(pod.Spec).To(HaveField("AutomountServiceAccountToken", &automountServiceAccountToken))
numContainers := 0
for range pod.Spec.Containers {