Skip to content

Commit 7d5881c

Browse files
committed
Fix IntegrationSink to use actual ServiceAccount name in auth proxy RoleBindings
Previously, MakeAuthProxyRoleBindings always used "default" as the ServiceAccount name. Now it uses makeServiceAccountName() to get the actual SA configured in the IntegrationSink spec, falling back to "default" if not specified. This resolves the TODO comment that noted the need to get the real SA of the pod.
1 parent 79d12a9 commit 7d5881c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pkg/reconciler/integration/sink/resources/container_image.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,9 +224,13 @@ func MakeAuthProxyRoleBindings(sink *v1alpha1.IntegrationSink, sinkLister v1alph
224224

225225
serviceAccounts := map[types.NamespacedName]struct{}{}
226226
for _, s := range sinks {
227+
saName := makeServiceAccountName(s)
228+
if saName == "" {
229+
saName = "default"
230+
}
227231
serviceAccounts[types.NamespacedName{
228232
Namespace: s.Namespace,
229-
Name: "default", //TODO: get the real SA of the pod, as it could be that the integrationsink pod does not run under the default SA
233+
Name: saName,
230234
}] = struct{}{}
231235
}
232236

0 commit comments

Comments
 (0)