Skip to content

Commit

Permalink
Merge pull request kosmos-io#457 from rxy0210/main_bug
Browse files Browse the repository at this point in the history
fix: fix 'automountServiceAccountToken' flag in the projected
  • Loading branch information
kosmos-robot authored Apr 3, 2024
2 parents 4df5b15 + 910f3a7 commit 98bf2a5
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 98bf2a5

Please sign in to comment.