mirror of
https://github.com/fluxcd/flux2.git
synced 2026-02-08 16:57:29 +00:00
Fix tenant service account binding
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
This commit is contained in:
parent
182928002b
commit
ffdaa9dfe9
1 changed files with 9 additions and 8 deletions
|
|
@ -55,8 +55,7 @@ reconcilers scope to the tenant namespaces.`,
|
|||
}
|
||||
|
||||
const (
|
||||
tenantLabel = "toolkit.fluxcd.io/tenant"
|
||||
tenantRoleBinding = "gotk-reconciler"
|
||||
tenantLabel = "toolkit.fluxcd.io/tenant"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
@ -123,18 +122,20 @@ func createTenantCmdRun(cmd *cobra.Command, args []string) error {
|
|||
|
||||
roleBinding := rbacv1.RoleBinding{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: tenantRoleBinding,
|
||||
Name: fmt.Sprintf("%s-reconciler", tenant),
|
||||
Namespace: ns,
|
||||
Labels: objLabels,
|
||||
},
|
||||
Subjects: []rbacv1.Subject{
|
||||
{
|
||||
Kind: "User",
|
||||
Name: fmt.Sprintf("gotk:%s:reconciler", ns),
|
||||
APIGroup: "rbac.authorization.k8s.io",
|
||||
Kind: "User",
|
||||
Name: fmt.Sprintf("gotk:%s:reconciler", ns),
|
||||
},
|
||||
{
|
||||
Kind: "ServiceAccount",
|
||||
Name: tenant,
|
||||
Kind: "ServiceAccount",
|
||||
Name: tenant,
|
||||
Namespace: ns,
|
||||
},
|
||||
},
|
||||
RoleRef: rbacv1.RoleRef{
|
||||
|
|
@ -290,7 +291,7 @@ func exportTenant(namespace corev1.Namespace, account corev1.ServiceAccount, rol
|
|||
fmt.Println(resourceToString(data))
|
||||
|
||||
account.TypeMeta = metav1.TypeMeta{
|
||||
APIVersion: "",
|
||||
APIVersion: "v1",
|
||||
Kind: "ServiceAccount",
|
||||
}
|
||||
data, err = yaml.Marshal(account)
|
||||
|
|
|
|||
Loading…
Reference in a new issue