Skip to content

Commit a978940

Browse files
committed
fix: for bounded service account token
1 parent aa8a0ce commit a978940

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

pkg/controller/vitessbackupstorage/reconcile_subcontroller.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,11 @@ func (r *ReconcileVitessBackupStorage) newSubcontrollerPodSpec(ctx context.Conte
136136
if strings.HasPrefix(volume.Name, tokenNamePrefix) {
137137
continue
138138
}
139+
// also skip volumes mounted by k8s v1.21+ BoundedServiceAccountToken
140+
// https://cloud.google.com/blog/products/containers-kubernetes/kubernetes-bound-service-account-tokens
141+
if strings.HasPrefix(volume.Name, "kube-api-access-") {
142+
continue
143+
}
139144
newVolumes = append(newVolumes, volume)
140145
}
141146
spec.Volumes = newVolumes
@@ -149,6 +154,11 @@ func (r *ReconcileVitessBackupStorage) newSubcontrollerPodSpec(ctx context.Conte
149154
if strings.HasPrefix(mount.Name, tokenNamePrefix) {
150155
continue
151156
}
157+
// also skip volumes mounted by k8s v1.21+ BoundedServiceAccountToken
158+
// https://cloud.google.com/blog/products/containers-kubernetes/kubernetes-bound-service-account-tokens
159+
if strings.HasPrefix(mount.Name, "kube-api-access-") {
160+
continue
161+
}
152162
newMounts = append(newMounts, mount)
153163
}
154164

0 commit comments

Comments
 (0)