Skip to content

Commit 09ec22a

Browse files
committed
rename to cluster because it's more generic
On-behalf-of: @SAP [email protected]
1 parent d1da99a commit 09ec22a

File tree

5 files changed

+24
-21
lines changed

5 files changed

+24
-21
lines changed

config/crd/bases/operator.kcp.io_kubeconfigs.yaml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,17 @@ spec:
5555
properties:
5656
clusterRoleBindings:
5757
properties:
58+
cluster:
59+
description: Cluster can be either a cluster name or a workspace
60+
path.
61+
type: string
5862
clusterRoles:
5963
items:
6064
type: string
6165
type: array
62-
workspacePath:
63-
type: string
6466
required:
67+
- cluster
6568
- clusterRoles
66-
- workspacePath
6769
type: object
6870
required:
6971
- clusterRoleBindings
@@ -371,10 +373,10 @@ spec:
371373
properties:
372374
authorization:
373375
properties:
374-
provisionedWorkspace:
376+
provisionedCluster:
375377
type: string
376378
required:
377-
- provisionedWorkspace
379+
- provisionedCluster
378380
type: object
379381
conditions:
380382
items:

internal/controller/kubeconfig-rbac/controller.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ func (r *KubeconfigRBACReconciler) reconcile(ctx context.Context, config *operat
114114
}
115115

116116
func (r *KubeconfigRBACReconciler) reconcileBindings(ctx context.Context, kc *operatorv1alpha1.Kubeconfig) error {
117-
targetClient, err := client.NewInternalKubeconfigClient(ctx, r.Client, kc, logicalcluster.Name(kc.Spec.Authorization.ClusterRoleBindings.WorkspacePath), nil)
117+
targetClient, err := client.NewInternalKubeconfigClient(ctx, r.Client, kc, logicalcluster.Name(kc.Spec.Authorization.ClusterRoleBindings.Cluster), nil)
118118
if err != nil {
119119
return fmt.Errorf("failed to create client to kubeconfig target: %w", err)
120120
}
@@ -171,7 +171,7 @@ func (r *KubeconfigRBACReconciler) handleDeletion(ctx context.Context, kc *opera
171171
return nil
172172
}
173173

174-
targetClient, err := client.NewInternalKubeconfigClient(ctx, r.Client, kc, logicalcluster.Name(kc.Spec.Authorization.ClusterRoleBindings.WorkspacePath), nil)
174+
targetClient, err := client.NewInternalKubeconfigClient(ctx, r.Client, kc, logicalcluster.Name(kc.Spec.Authorization.ClusterRoleBindings.Cluster), nil)
175175
if err != nil {
176176
return fmt.Errorf("failed to create client to kubeconfig target: %w", err)
177177
}

sdk/apis/operator/v1alpha1/kubeconfig_types.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,9 @@ type KubeconfigAuthorization struct {
5858
}
5959

6060
type KubeconfigClusterRoleBindings struct {
61-
WorkspacePath string `json:"workspacePath"`
62-
ClusterRoles []string `json:"clusterRoles"`
61+
// Cluster can be either a cluster name or a workspace path.
62+
Cluster string `json:"cluster"`
63+
ClusterRoles []string `json:"clusterRoles"`
6364
}
6465

6566
type KubeconfigPhase string
@@ -86,7 +87,7 @@ type KubeconfigStatus struct {
8687
}
8788

8889
type KubeconfigAuthorizationStatus struct {
89-
ProvisionedWorkspace string `json:"provisionedWorkspace"`
90+
ProvisionedCluster string `json:"provisionedCluster"`
9091
}
9192

9293
// +genclient

sdk/applyconfiguration/operator/v1alpha1/kubeconfigauthorizationstatus.go

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/applyconfiguration/operator/v1alpha1/kubeconfigclusterrolebindings.go

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)