mirror of
https://github.com/containers/podman.git
synced 2025-06-21 17:38:12 +08:00
Merge pull request #15607 from fpoirotte/main
Fix #15243 Set AutomountServiceAccountToken to false
This commit is contained in:
@ -470,6 +470,8 @@ func newPodObject(podName string, annotations map[string]string, initCtrs, conta
|
|||||||
}
|
}
|
||||||
// Set enableServiceLinks to false as podman doesn't use the service port environment variables
|
// Set enableServiceLinks to false as podman doesn't use the service port environment variables
|
||||||
enableServiceLinks := false
|
enableServiceLinks := false
|
||||||
|
// Set automountServiceAccountToken to false as podman doesn't use service account tokens
|
||||||
|
automountServiceAccountToken := false
|
||||||
ps := v1.PodSpec{
|
ps := v1.PodSpec{
|
||||||
Containers: containers,
|
Containers: containers,
|
||||||
Hostname: hostname,
|
Hostname: hostname,
|
||||||
@ -477,6 +479,7 @@ func newPodObject(podName string, annotations map[string]string, initCtrs, conta
|
|||||||
InitContainers: initCtrs,
|
InitContainers: initCtrs,
|
||||||
Volumes: volumes,
|
Volumes: volumes,
|
||||||
EnableServiceLinks: &enableServiceLinks,
|
EnableServiceLinks: &enableServiceLinks,
|
||||||
|
AutomountServiceAccountToken: &automountServiceAccountToken,
|
||||||
}
|
}
|
||||||
if dnsOptions != nil && (len(dnsOptions.Nameservers)+len(dnsOptions.Searches)+len(dnsOptions.Options) > 0) {
|
if dnsOptions != nil && (len(dnsOptions.Nameservers)+len(dnsOptions.Searches)+len(dnsOptions.Options) > 0) {
|
||||||
ps.DNSConfig = dnsOptions
|
ps.DNSConfig = dnsOptions
|
||||||
|
@ -73,6 +73,8 @@ var _ = Describe("Podman generate kube", func() {
|
|||||||
Expect(pod).To(HaveField("Name", "top-pod"))
|
Expect(pod).To(HaveField("Name", "top-pod"))
|
||||||
enableServiceLinks := false
|
enableServiceLinks := false
|
||||||
Expect(pod.Spec).To(HaveField("EnableServiceLinks", &enableServiceLinks))
|
Expect(pod.Spec).To(HaveField("EnableServiceLinks", &enableServiceLinks))
|
||||||
|
automountServiceAccountToken := false
|
||||||
|
Expect(pod.Spec).To(HaveField("AutomountServiceAccountToken", &automountServiceAccountToken))
|
||||||
|
|
||||||
numContainers := 0
|
numContainers := 0
|
||||||
for range pod.Spec.Containers {
|
for range pod.Spec.Containers {
|
||||||
@ -169,6 +171,8 @@ var _ = Describe("Podman generate kube", func() {
|
|||||||
Expect(pod.Spec).To(HaveField("HostNetwork", false))
|
Expect(pod.Spec).To(HaveField("HostNetwork", false))
|
||||||
enableServiceLinks := false
|
enableServiceLinks := false
|
||||||
Expect(pod.Spec).To(HaveField("EnableServiceLinks", &enableServiceLinks))
|
Expect(pod.Spec).To(HaveField("EnableServiceLinks", &enableServiceLinks))
|
||||||
|
automountServiceAccountToken := false
|
||||||
|
Expect(pod.Spec).To(HaveField("AutomountServiceAccountToken", &automountServiceAccountToken))
|
||||||
|
|
||||||
numContainers := 0
|
numContainers := 0
|
||||||
for range pod.Spec.Containers {
|
for range pod.Spec.Containers {
|
||||||
|
Reference in New Issue
Block a user