diff --git a/pkg/registry/core/project/storage.go b/pkg/registry/core/project/storage.go index e65669d10..4f3cc1ab1 100644 --- a/pkg/registry/core/project/storage.go +++ b/pkg/registry/core/project/storage.go @@ -122,6 +122,8 @@ func (r *Storage) ConvertToTable(ctx context.Context, object runtime.Object, tab return r.convertor.ConvertToTable(ctx, object, tableOptions) } +const fakeProjectId = "p-fake" + func ListRancherProjects(kc client.Client) ([]rscoreapi.Project, error) { var list core.NamespaceList err := kc.List(context.TODO(), &list) @@ -136,7 +138,7 @@ func ListRancherProjects(kc client.Client) ([]rscoreapi.Project, error) { for _, ns := range list.Items { projectId, exists := ns.Labels[clustermeta.LabelKeyRancherFieldProjectId] if !exists { - continue + projectId = fakeProjectId } project, exists := projects[projectId]