feat: create a project for a user on signup as well as an org#179
feat: create a project for a user on signup as well as an org#179mattdjenkinson merged 2 commits intomainfrom
Conversation
internal/controller/resourcemanager/personal_organization_controller.go
Outdated
Show resolved
Hide resolved
| } | ||
| _, err = controllerutil.CreateOrUpdate(ctx, r.Client, personalProject, func() error { | ||
| logger.Info("Creating or updating personal project", "organization", personalOrg.Name, "project", personalProject.Name) | ||
| metav1.SetMetaDataAnnotation(&personalProject.ObjectMeta, "kubernetes.io/display-name", "Personal Project") |
There was a problem hiding this comment.
Do we show both the Description and the Display Name in the staff portal when listing projects? If we don't, we'll just see a big list of projects with the same display name.
There was a problem hiding this comment.
We could probably do with adding a user column to that table as well to make it even easier to see the customer details quickly.
There was a problem hiding this comment.
I think the description would work. Getting the user into that view doesn't make much sense because there's no single owner of a project and this table needs to support projects associated with single-user organizations and standard organizations.
Implementation Guidance: Fix Personal Project CreationThe webhook error occurs because Milo's Solution: Client Impersonation with Extra FieldsMilo already has a pattern for this in impersonatedConfig := rest.CopyConfig(r.RestConfig)
impersonatedConfig.Impersonate = rest.ImpersonationConfig{
Extra: map[string][]string{
"iam.miloapis.com/parent-name": {org.Name},
"iam.miloapis.com/parent-type": {"Organization"},
"iam.miloapis.com/parent-api-group": {"resourcemanager.miloapis.com"},
},
}
impersonatedClient, err := client.New(impersonatedConfig, client.Options{Scheme: r.Scheme})
// Use impersonatedClient.Create() for project creationThe controller needs access to See: |

As part of datum-cloud/enhancements#602 we want to create a default project for new users on signup.