Skip to content

Commit

Permalink
fix: fix 'automountServiceAccountToken' flag in the projected
Browse files Browse the repository at this point in the history
Signed-off-by: renxiangyu <[email protected]>
  • Loading branch information
renxiangyu committed Apr 1, 2024
1 parent 0c6ee8c commit a55d074
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -565,15 +565,15 @@ func (r *RootPodReconciler) changeToMasterCoreDNS(ctx context.Context, pod *core
// projectedHandler Process the project volume, creating and mounting secret, configmap, DownwardAPI,
// and ServiceAccountToken from the project volume in the member cluster to the pod of the host cluster
func (r *RootPodReconciler) projectedHandler(ctx context.Context, lr *leafUtils.LeafResource, pod *corev1.Pod) {
if pod.Spec.Volumes == nil {
falseValue := false
pod.Spec.AutomountServiceAccountToken = &falseValue

if len(pod.Spec.Volumes) == 0 {
return
}

for _, volume := range pod.Spec.Volumes {
if volume.Projected != nil {
falseValue := false
pod.Spec.AutomountServiceAccountToken = &falseValue

saName := pod.Spec.ServiceAccountName
var sources []corev1.VolumeProjection

Expand Down

0 comments on commit a55d074

Please sign in to comment.