Skip to content

Commit 2e7beea

Browse files
committed
move cluster resources to platform cluster
1 parent 4a8ea26 commit 2e7beea

File tree

11 files changed

+78
-48
lines changed

11 files changed

+78
-48
lines changed

api/clusters/v1alpha1/accessrequest_types.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ type AccessRequestSpec struct {
1212
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="clusterRef is immutable"
1313
ClusterRef NamespacedObjectReference `json:"clusterRef"`
1414

15+
// RequestRef is the reference to the ClusterRequest for whose Cluster access is requested.
16+
// Exactly one of clusterRef or requestRef must be set.
17+
// This value is immutable.
18+
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="requestRef is immutable"
19+
RequestRef NamespacedObjectReference `json:"requestRef"`
20+
1521
// Permissions are the requested permissions.
1622
Permissions []PermissionsRequest `json:"permissions"`
1723
}
@@ -34,12 +40,13 @@ type AccessRequestStatus struct {
3440
// Phase is the current phase of the request.
3541
Phase RequestPhase `json:"phase"`
3642

37-
// TODO: expose actual access information
43+
// SecretRef holds the reference to the secret that contains the actual credentials.
44+
SecretRef *NamespacedObjectReference `json:"secretRef,omitempty"`
3845
}
3946

4047
// +kubebuilder:object:root=true
4148
// +kubebuilder:subresource:status
42-
// +kubebuilder:metadata:labels="openmcp.cloud/cluster=onboarding"
49+
// +kubebuilder:metadata:labels="openmcp.cloud/cluster=platform"
4350

4451
// AccessRequest is the Schema for the accessrequests API
4552
type AccessRequest struct {

api/clusters/v1alpha1/cluster_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ const (
8181

8282
// +kubebuilder:object:root=true
8383
// +kubebuilder:subresource:status
84-
// +kubebuilder:metadata:labels="openmcp.cloud/cluster=onboarding"
84+
// +kubebuilder:metadata:labels="openmcp.cloud/cluster=platform"
8585
// +kubebuilder:selectablefield:JSONPath=".spec.clusterProfileRef.name"
8686
// +kubebuilder:printcolumn:JSONPath=".spec.purposes",name="Purposes",type=string
8787
// +kubebuilder:printcolumn:JSONPath=`.status.phase`,name="Phase",type=string

api/clusters/v1alpha1/clusterprofile_types.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ import (
66

77
// ClusterProfileSpec defines the desired state of Provider.
88
type ClusterProfileSpec struct {
9-
// Environment is the environment in which the ClusterProvider resides.
10-
Environment string `json:"environment"`
11-
129
// ProviderRef is a reference to the ClusterProvider
1310
ProviderRef ObjectReference `json:"providerRef"`
1411

@@ -30,11 +27,9 @@ type SupportedK8sVersion struct {
3027

3128
// +kubebuilder:object:root=true
3229
// +kubebuilder:resource:scope=Cluster,shortName=cprof;profile
33-
// +kubebuilder:metadata:labels="openmcp.cloud/cluster=onboarding"
34-
// +kubebuilder:selectablefield:JSONPath=".spec.environment"
30+
// +kubebuilder:metadata:labels="openmcp.cloud/cluster=platform"
3531
// +kubebuilder:selectablefield:JSONPath=".spec.providerRef.name"
3632
// +kubebuilder:selectablefield:JSONPath=".spec.providerConfigRef.name"
37-
// +kubebuilder:printcolumn:JSONPath=".spec.environment",name="Env",type=string
3833
// +kubebuilder:printcolumn:JSONPath=".spec.providerRef.name",name="Provider",type=string
3934
// +kubebuilder:printcolumn:JSONPath=".spec.providerConfigRef.name",name="Config",type=string
4035

api/clusters/v1alpha1/clusterrequest_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ type RequestPhase string
3030
// +kubebuilder:object:root=true
3131
// +kubebuilder:subresource:status
3232
// +kubebuilder:resource:shortName=cr;creq;request
33-
// +kubebuilder:metadata:labels="openmcp.cloud/cluster=onboarding"
33+
// +kubebuilder:metadata:labels="openmcp.cloud/cluster=platform"
3434
// +kubebuilder:selectablefield:JSONPath=".spec.purpose"
3535
// +kubebuilder:selectablefield:JSONPath=".status.phase"
3636
// +kubebuilder:printcolumn:JSONPath=".spec.purpose",name="Purpose",type=string

api/clusters/v1alpha1/zz_generated.deepcopy.go

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

api/crds/manifests/clusters.openmcp.cloud_accessrequests.yaml

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ metadata:
55
annotations:
66
controller-gen.kubebuilder.io/version: v0.17.3
77
labels:
8-
openmcp.cloud/cluster: onboarding
8+
openmcp.cloud/cluster: platform
99
name: accessrequests.clusters.openmcp.cloud
1010
spec:
1111
group: clusters.openmcp.cloud
@@ -125,9 +125,30 @@ spec:
125125
- rules
126126
type: object
127127
type: array
128+
requestRef:
129+
description: |-
130+
RequestRef is the reference to the ClusterRequest for whose Cluster access is requested.
131+
Exactly one of clusterRef or requestRef must be set.
132+
This value is immutable.
133+
properties:
134+
name:
135+
description: Name is the name of the referenced resource.
136+
minLength: 1
137+
type: string
138+
namespace:
139+
description: Namespace is the namespace of the referenced resource.
140+
type: string
141+
required:
142+
- name
143+
- namespace
144+
type: object
145+
x-kubernetes-validations:
146+
- message: requestRef is immutable
147+
rule: self == oldSelf
128148
required:
129149
- clusterRef
130150
- permissions
151+
- requestRef
131152
type: object
132153
status:
133154
description: AccessRequestStatus defines the observed state of AccessRequest
@@ -187,6 +208,21 @@ spec:
187208
description: Reason is expected to contain a CamelCased string that
188209
provides further information in a machine-readable format.
189210
type: string
211+
secretRef:
212+
description: SecretRef holds the reference to the secret that contains
213+
the actual credentials.
214+
properties:
215+
name:
216+
description: Name is the name of the referenced resource.
217+
minLength: 1
218+
type: string
219+
namespace:
220+
description: Namespace is the namespace of the referenced resource.
221+
type: string
222+
required:
223+
- name
224+
- namespace
225+
type: object
190226
required:
191227
- lastReconcileTime
192228
- observedGeneration

api/crds/manifests/clusters.openmcp.cloud_clusterprofiles.yaml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ metadata:
55
annotations:
66
controller-gen.kubebuilder.io/version: v0.17.3
77
labels:
8-
openmcp.cloud/cluster: onboarding
8+
openmcp.cloud/cluster: platform
99
name: clusterprofiles.clusters.openmcp.cloud
1010
spec:
1111
group: clusters.openmcp.cloud
@@ -20,9 +20,6 @@ spec:
2020
scope: Cluster
2121
versions:
2222
- additionalPrinterColumns:
23-
- jsonPath: .spec.environment
24-
name: Env
25-
type: string
2623
- jsonPath: .spec.providerRef.name
2724
name: Provider
2825
type: string
@@ -53,10 +50,6 @@ spec:
5350
spec:
5451
description: ClusterProfileSpec defines the desired state of Provider.
5552
properties:
56-
environment:
57-
description: Environment is the environment in which the ClusterProvider
58-
resides.
59-
type: string
6053
providerConfigRef:
6154
description: ProviderConfigRef is a reference to the provider-specific
6255
configuration.
@@ -94,14 +87,12 @@ spec:
9487
type: object
9588
type: array
9689
required:
97-
- environment
9890
- providerConfigRef
9991
- providerRef
10092
- supportedVersions
10193
type: object
10294
type: object
10395
selectableFields:
104-
- jsonPath: .spec.environment
10596
- jsonPath: .spec.providerRef.name
10697
- jsonPath: .spec.providerConfigRef.name
10798
served: true

api/crds/manifests/clusters.openmcp.cloud_clusterrequests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ metadata:
55
annotations:
66
controller-gen.kubebuilder.io/version: v0.17.3
77
labels:
8-
openmcp.cloud/cluster: onboarding
8+
openmcp.cloud/cluster: platform
99
name: clusterrequests.clusters.openmcp.cloud
1010
spec:
1111
group: clusters.openmcp.cloud

api/crds/manifests/clusters.openmcp.cloud_clusters.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ metadata:
55
annotations:
66
controller-gen.kubebuilder.io/version: v0.17.3
77
labels:
8-
openmcp.cloud/cluster: onboarding
8+
openmcp.cloud/cluster: platform
99
name: clusters.clusters.openmcp.cloud
1010
spec:
1111
group: clusters.openmcp.cloud

cmd/openmcp-operator/app/run.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ func (o *RunOptions) Run(ctx context.Context) error {
287287

288288
// setup cluster scheduler
289289
if slices.Contains(o.Controllers, strings.ToLower(scheduler.ControllerName)) {
290-
sc, err := scheduler.NewClusterScheduler(&setupLog, o.Clusters.Onboarding, o.Config.Scheduler)
290+
sc, err := scheduler.NewClusterScheduler(&setupLog, o.Clusters.Platform, o.Config.Scheduler)
291291
if err != nil {
292292
return fmt.Errorf("unable to initialize cluster scheduler: %w", err)
293293
}

0 commit comments

Comments
 (0)