Skip to content

Commit 28da5d3

Browse files
committed
Only create new service account secret if not already present.
1 parent 7c01a5f commit 28da5d3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

api/v2/helper/seed_access.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ func ensureSeedRBAC(ctx context.Context, seedConfig *rest.Config, deploy *v2.Fir
8080
return fmt.Errorf("error ensuring service account: %w", err)
8181
}
8282

83-
if versionGreaterOrEqual124(k8sVersion) {
83+
if versionGreaterOrEqual124(k8sVersion) && len(serviceAccount.Secrets) == 0 {
8484
serviceAccountSecret := &corev1.Secret{
8585
ObjectMeta: metav1.ObjectMeta{
8686
Name: name,
@@ -198,7 +198,7 @@ func ensureShootRBAC(ctx context.Context, shootConfig *rest.Config, shootNamespa
198198
return fmt.Errorf("error ensuring service account: %w", err)
199199
}
200200

201-
if versionGreaterOrEqual124(k8sVersion) {
201+
if versionGreaterOrEqual124(k8sVersion) && len(serviceAccount.Secrets) == 0 {
202202
serviceAccountSecret := &corev1.Secret{
203203
ObjectMeta: metav1.ObjectMeta{
204204
Name: name,

0 commit comments

Comments
 (0)