Skip to content

Commit 5f62323

Browse files
committed
fix kubebuilder CRD generation annotations
1 parent 2e7beea commit 5f62323

File tree

6 files changed

+18
-12
lines changed

6 files changed

+18
-12
lines changed

api/clusters/v1alpha1/accessrequest_types.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,10 @@ type AccessRequestStatus struct {
4646

4747
// +kubebuilder:object:root=true
4848
// +kubebuilder:subresource:status
49+
// +kubebuilder:resource:shortName=ar;areq
4950
// +kubebuilder:metadata:labels="openmcp.cloud/cluster=platform"
51+
// +kubebuilder:selectablefield:JSONPath=".status.phase"
52+
// +kubebuilder:printcolumn:JSONPath=".status.phase",name="Phase",type=string
5053

5154
// AccessRequest is the Schema for the accessrequests API
5255
type AccessRequest struct {

api/clusters/v1alpha1/cluster_types.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,13 @@ const (
8282
// +kubebuilder:object:root=true
8383
// +kubebuilder:subresource:status
8484
// +kubebuilder:metadata:labels="openmcp.cloud/cluster=platform"
85-
// +kubebuilder:selectablefield:JSONPath=".spec.clusterProfileRef.name"
85+
// +kubebuilder:selectablefield:JSONPath=".spec.profile"
8686
// +kubebuilder:printcolumn:JSONPath=".spec.purposes",name="Purposes",type=string
8787
// +kubebuilder:printcolumn:JSONPath=`.status.phase`,name="Phase",type=string
8888
// +kubebuilder:printcolumn:JSONPath=`.metadata.annotations["clusters.openmcp.cloud/k8sversion"]`,name="Version",type=string
8989
// +kubebuilder:printcolumn:JSONPath=`.metadata.annotations["clusters.openmcp.cloud/profile"]`,name="Profile",type=string
90-
// +kubebuilder:printcolumn:JSONPath=`.metadata.labels["environment.clusters.openmcp.cloud"]`,name="Env",type=string,priority=10
9190
// +kubebuilder:printcolumn:JSONPath=`.metadata.labels["provider.clusters.openmcp.cloud"]`,name="Provider",type=string, priority=10
92-
// +kubebuilder:printcolumn:JSONPath=".spec.clusterProfileRef.name",name="ProfileRef",type=string,priority=10
91+
// +kubebuilder:printcolumn:JSONPath=".spec.profile",name="ProfileRef",type=string,priority=10
9392
// +kubebuilder:printcolumn:JSONPath=`.metadata.annotations["clusters.openmcp.cloud/providerinfo"]`,name="Info",type=string,priority=10
9493
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
9594

api/clusters/v1alpha1/clusterrequest_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ type RequestPhase string
2929

3030
// +kubebuilder:object:root=true
3131
// +kubebuilder:subresource:status
32-
// +kubebuilder:resource:shortName=cr;creq;request
32+
// +kubebuilder:resource:shortName=cr;creq
3333
// +kubebuilder:metadata:labels="openmcp.cloud/cluster=platform"
3434
// +kubebuilder:selectablefield:JSONPath=".spec.purpose"
3535
// +kubebuilder:selectablefield:JSONPath=".status.phase"

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,17 @@ spec:
1313
kind: AccessRequest
1414
listKind: AccessRequestList
1515
plural: accessrequests
16+
shortNames:
17+
- ar
18+
- areq
1619
singular: accessrequest
1720
scope: Namespaced
1821
versions:
19-
- name: v1alpha1
22+
- additionalPrinterColumns:
23+
- jsonPath: .status.phase
24+
name: Phase
25+
type: string
26+
name: v1alpha1
2027
schema:
2128
openAPIV3Schema:
2229
description: AccessRequest is the Schema for the accessrequests API
@@ -229,6 +236,8 @@ spec:
229236
- phase
230237
type: object
231238
type: object
239+
selectableFields:
240+
- jsonPath: .status.phase
232241
served: true
233242
storage: true
234243
subresources:

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ spec:
1616
shortNames:
1717
- cr
1818
- creq
19-
- request
2019
singular: clusterrequest
2120
scope: Namespaced
2221
versions:

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,11 @@ spec:
2929
- jsonPath: .metadata.annotations["clusters.openmcp.cloud/profile"]
3030
name: Profile
3131
type: string
32-
- jsonPath: .metadata.labels["environment.clusters.openmcp.cloud"]
33-
name: Env
34-
priority: 10
35-
type: string
3632
- jsonPath: .metadata.labels["provider.clusters.openmcp.cloud"]
3733
name: Provider
3834
priority: 10
3935
type: string
40-
- jsonPath: .spec.clusterProfileRef.name
36+
- jsonPath: .spec.profile
4137
name: ProfileRef
4238
priority: 10
4339
type: string
@@ -194,7 +190,7 @@ spec:
194190
type: object
195191
type: object
196192
selectableFields:
197-
- jsonPath: .spec.clusterProfileRef.name
193+
- jsonPath: .spec.profile
198194
served: true
199195
storage: true
200196
subresources:

0 commit comments

Comments
 (0)