manifests icon indicating copy to clipboard operation
manifests copied to clipboard

One owner multiple namespaces

Open gfarcas opened this issue 11 months ago • 4 comments

I have tried creating two profiles with the same user as owner The drop down shows me as owner on both image But when I go to contributing it is different image These are the profile controller logs:

1.7095676167748752e+09	INFO	controllers.Profile	Start to Reconcile.	{"profile": "/upgrade", "namespace": "", "name": "upgrade"}
1.7095676167749074e+09	INFO	controllers.Profile	List of labels to be added to namespace	{"profile": "/upgrade", "labels": {"app.kubernetes.io/part-of":"kubeflow-profile","istio-injection":"enabled","katib.kubeflow.org/metrics-collector-injection":"enabled","pipelines.kubeflow.org/enabled":"true","serving.kubeflow.org/inferenceservice":"enabled"}}
1.709567616774934e+09	INFO	controllers.Profile	List of labels to be added to found namespace	{"profile": "/upgrade", "labels": {"app.kubernetes.io/part-of":"kubeflow-profile","istio-injection":"enabled","katib.kubeflow.org/metrics-collector-injection":"enabled","pipelines.kubeflow.org/enabled":"true","serving.kubeflow.org/inferenceservice":"enabled"}}
1.7095676167751784e+09	INFO	controllers.Profile	Updating RoleBinding	{"profile": "upgrade", "namespace": "upgrade", "name": "namespaceAdmin"}
1.7095676168882513e+09	INFO	controllers.Profile	Start to Reconcile.	{"profile": "/bi-ds", "namespace": "", "name": "bi-ds"}
1.709567616888275e+09	INFO	controllers.Profile	List of labels to be added to namespace	{"profile": "/bi-ds", "labels": {"app.kubernetes.io/part-of":"kubeflow-profile","istio-injection":"enabled","katib.kubeflow.org/metrics-collector-injection":"enabled","pipelines.kubeflow.org/enabled":"true","serving.kubeflow.org/inferenceservice":"enabled"}}
1.7095676168882942e+09	INFO	controllers.Profile	List of labels to be added to found namespace	{"profile": "/bi-ds", "labels": {"app.kubernetes.io/part-of":"kubeflow-profile","istio-injection":"enabled","katib.kubeflow.org/metrics-collector-injection":"enabled","pipelines.kubeflow.org/enabled":"true","serving.kubeflow.org/inferenceservice":"enabled"}}
1.7095676168884087e+09	INFO	controllers.Profile	Updating RoleBinding	{"profile": "bi-ds", "namespace": "bi-ds", "name": "namespaceAdmin"}

Version: 1.8.0

gfarcas avatar Mar 04 '24 16:03 gfarcas

Can you share the Profile CRD YAML for each profile?

thesuperzapper avatar Mar 05 '24 19:03 thesuperzapper

Sure! Here they are:

#first profile
apiVersion: kubeflow.org/v1
kind: Profile
metadata:
  name: bi-ds
spec:
  owner:
    kind: User
    name: [email protected]
  resourceQuotaSpec:
    hard:
      cpu: '32'
      memory: 256Gi

#second profile
apiVersion: kubeflow.org/v1
kind: Profile
metadata:
  name: upgrade
spec:
  owner:
    kind: User
    name: [email protected]
  resourceQuotaSpec:
    hard:
      cpu: '32'
      memory: 256Gi

They are basicaly the same, only the name in metadata differs.

gfarcas avatar Mar 06 '24 07:03 gfarcas

i also have same issue, so added contributors manually via rolebinding UI shows single namespace with owner

infa-ddeore avatar Mar 07 '24 03:03 infa-ddeore

The issue seems to be in the central dashboard, not in the profile: https://github.com/kubeflow/kubeflow/blob/167e162ef7dffc033ddc82e55b0a108db27fc340/components/centraldashboard/public/components/manage-users-view.js#L56-L72

    nsBreakdown(ns) {
        const {ownedNamespace, namespaces} = this;
        if (!ownedNamespace || !namespaces) return;
        const arr = [
            [ownedNamespace.namespace, 'Owner'],
        ];
        if (ns.length <= 1) return arr;
        const otherNamespaces = namespaces
            .filter((n) => n != ownedNamespace
                        && n.namespace !== ALL_NAMESPACES)
            .map((i) => i.namespace).join(', ');
        if (!otherNamespaces.length) return arr;
        arr.push(
            [otherNamespaces, 'Contributor'],
        );
        return arr;
    }

I checked the /api/workgroup/get-all-namespaces api endpoint and I am returned as owner on both (first json object)

gfarcas avatar Mar 08 '24 09:03 gfarcas