Fix no kind FederatedGroupBinding is registered

This commit is contained in:
hongming
2021-10-21 11:22:18 +08:00
parent 744233b3a3
commit 20163dd795
2 changed files with 15 additions and 2 deletions

View File

@@ -477,8 +477,19 @@ func (r *Reconciler) deleteHelmRepos(ctx context.Context, ws string) error {
// deleteNamespacesInWorkspace Deletes the namespace associated with the workspace, which match the workspace label selector
func (r *Reconciler) deleteNamespacesInWorkspace(ctx context.Context, template *tenantv1alpha2.WorkspaceTemplate) error {
namespace := &corev1.Namespace{}
return r.DeleteAllOf(ctx, namespace, client.MatchingLabels{tenantv1alpha1.WorkspaceLabel: template.Name})
namespaceList := &corev1.NamespaceList{}
err := r.Client.List(ctx, namespaceList, client.MatchingLabels{tenantv1alpha1.WorkspaceLabel: template.Name})
if err != nil {
return err
}
for _, namespace := range namespaceList.Items {
err = r.Client.Delete(ctx, &namespace)
if err != nil {
return err
}
}
return nil
}
func workspaceRoleBindingChanger(workspaceRoleBinding *iamv1alpha2.WorkspaceRoleBinding, workspace, username, workspaceRoleName string) controllerutil.MutateFn {

View File

@@ -79,6 +79,8 @@ func init() {
&FederatedUserList{},
&FederatedGroup{},
&FederatedGroupList{},
&FederatedGroupBinding{},
&FederatedGroupBindingList{},
&FederatedWorkspace{},
&FederatedWorkspaceList{},
&FederatedWorkspaceRole{},