Skip to content

Commit a83e9fb

Browse files
Ambient Code Botclaude
andcommitted
fix(control-plane): use project kube client for namespace provisioner
When PROJECT_KUBE_TOKEN_FILE is set, the project kube client carries the TSA identity (tenantaccess-ambient-control-plane) which already has namespace-admin RoleBindings in ambient-code--config. The main in-cluster SA does not have access to tenantnamespaces.tenant.paas.redhat.com. Pass projectKube to buildNamespaceProvisioner when available so the MPP TenantNamespace provisioner uses the TSA token rather than the pod SA token. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 3790b69 commit a83e9fb

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

  • components/ambient-control-plane/cmd/ambient-control-plane

components/ambient-control-plane/cmd/ambient-control-plane/main.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,11 @@ func runKubeMode(ctx context.Context, cfg *config.ControlPlaneConfig) error {
113113
log.Info().Str("token_file", cfg.ProjectKubeTokenFile).Msg("using separate project kube client")
114114
}
115115

116-
provisioner := buildNamespaceProvisioner(cfg, kube)
116+
provisionerKube := kube
117+
if projectKube != nil {
118+
provisionerKube = projectKube
119+
}
120+
provisioner := buildNamespaceProvisioner(cfg, provisionerKube)
117121
tokenProvider := buildTokenProvider(cfg, log.Logger)
118122

119123
factory := reconciler.NewSDKClientFactory(cfg.APIServerURL, tokenProvider, log.Logger)

0 commit comments

Comments
 (0)