Skip to content

Commit

Permalink
Merge pull request #401 from gthiemonge/fix_automount
Browse files Browse the repository at this point in the history
Set AutomountServiceAccountToken to false
  • Loading branch information
openshift-merge-bot[bot] authored Jan 14, 2025
2 parents 3f54fba + 08500c3 commit 575fc03
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 5 deletions.
1 change: 1 addition & 0 deletions pkg/amphoracontrollers/daemonset.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ func DaemonSet(
},
TerminationGracePeriodSeconds: &terminationGracePeriodSeconds,
ServiceAccountName: instance.Spec.ServiceAccount,
AutomountServiceAccountToken: ptr.To(false),
Containers: []corev1.Container{
{
Name: serviceName,
Expand Down
5 changes: 3 additions & 2 deletions pkg/octavia/dbsync.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,9 @@ func DbSyncJob(
SecurityContext: &corev1.PodSecurityContext{
FSGroup: ptr.To(OctaviaUID),
},
RestartPolicy: corev1.RestartPolicyOnFailure,
ServiceAccountName: instance.RbacResourceName(),
RestartPolicy: corev1.RestartPolicyOnFailure,
ServiceAccountName: instance.RbacResourceName(),
AutomountServiceAccountToken: ptr.To(false),
Containers: []corev1.Container{
{
Name: ServiceName + "-db-sync",
Expand Down
4 changes: 3 additions & 1 deletion pkg/octavia/image_upload_deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/utils/ptr"
)

type ImageUploadDetails struct {
Expand Down Expand Up @@ -107,7 +108,8 @@ func ImageUploadDeployment(
Labels: labels,
},
Spec: corev1.PodSpec{
ServiceAccountName: instance.RbacResourceName(),
ServiceAccountName: instance.RbacResourceName(),
AutomountServiceAccountToken: ptr.To(false),
Containers: []corev1.Container{
{
Name: "octavia-amphora-httpd",
Expand Down
3 changes: 2 additions & 1 deletion pkg/octaviaapi/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@ func Deployment(
SecurityContext: &corev1.PodSecurityContext{
FSGroup: ptr.To(octavia.OctaviaUID),
},
ServiceAccountName: instance.Spec.ServiceAccount,
ServiceAccountName: instance.Spec.ServiceAccount,
AutomountServiceAccountToken: ptr.To(false),
Containers: []corev1.Container{
{
Name: serviceName,
Expand Down
3 changes: 2 additions & 1 deletion pkg/octaviarsyslog/daemonset.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ func DaemonSet(
Labels: labels,
},
Spec: corev1.PodSpec{
ServiceAccountName: instance.Spec.ServiceAccount,
ServiceAccountName: instance.Spec.ServiceAccount,
AutomountServiceAccountToken: ptr.To(false),
Containers: []corev1.Container{
{
Name: serviceName,
Expand Down
1 change: 1 addition & 0 deletions tests/kuttl/common/assert_sample_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ spec:
- octavia-api
topologyKey: kubernetes.io/hostname
weight: 100
automountServiceAccountToken: false
containers:
- args:
- -c
Expand Down

0 comments on commit 575fc03

Please sign in to comment.