From bdcca2e785968f0abc1d0f9c8bc270f80e5cb12c Mon Sep 17 00:00:00 2001 From: Simon Murray Date: Wed, 10 Apr 2024 15:39:48 +0100 Subject: [PATCH] Fix Server RBAC (#40) I can no longer see organizations and projects, but I do get to see namespaces, and I can derive where to place things from that. --- charts/unikorn/Chart.yaml | 4 ++-- charts/unikorn/templates/unikorn-server.yaml | 10 ++++++++-- pkg/server/handler/clustermanager/client.go | 3 --- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/charts/unikorn/Chart.yaml b/charts/unikorn/Chart.yaml index a0ef6cad..d45b5680 100644 --- a/charts/unikorn/Chart.yaml +++ b/charts/unikorn/Chart.yaml @@ -4,7 +4,7 @@ description: A Helm chart for deploying Unikorn type: application -version: v0.2.0 -appVersion: v0.2.0 +version: v0.2.1 +appVersion: v0.2.1 icon: https://raw.githubusercontent.com/unikorn-cloud/unikorn/main/icons/default.png diff --git a/charts/unikorn/templates/unikorn-server.yaml b/charts/unikorn/templates/unikorn-server.yaml index 712e323b..5875973b 100644 --- a/charts/unikorn/templates/unikorn-server.yaml +++ b/charts/unikorn/templates/unikorn-server.yaml @@ -21,8 +21,6 @@ rules: - apiGroups: - unikorn-cloud.org resources: - - organizations - - projects - clustermanagers - kubernetesclusters verbs: @@ -42,6 +40,14 @@ rules: verbs: - list - watch +# Find project namespaces +- apiGroups: + - "" + resources: + - namespaces + verbs: + - list + - watch # Get secrets, ugh, for kubeconfigs. - apiGroups: - "" diff --git a/pkg/server/handler/clustermanager/client.go b/pkg/server/handler/clustermanager/client.go index ffb61ace..8243f6c5 100644 --- a/pkg/server/handler/clustermanager/client.go +++ b/pkg/server/handler/clustermanager/client.go @@ -20,7 +20,6 @@ package clustermanager import ( "context" goerrors "errors" - "fmt" "slices" unikornv1core "github.com/unikorn-cloud/core/pkg/apis/unikorn/v1alpha1" @@ -272,8 +271,6 @@ func (c *Client) generate(ctx context.Context, namespace *corev1.Namespace, orga return nil, err } - fmt.Println(applicationBundle) - controlPlane := &unikornv1.ClusterManager{ ObjectMeta: metav1.ObjectMeta{ Name: parameters.Name,