Skip to content

Commit 9b232de

Browse files
authored
feat: print columns, field selectors, status handling, unit test (#32)
1 parent 5c1ad21 commit 9b232de

19 files changed

+581
-347
lines changed

api/crds/manifests/openmcp.cloud_clusterproviders.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ spec:
1616
singular: clusterprovider
1717
scope: Cluster
1818
versions:
19-
- name: v1alpha1
19+
- additionalPrinterColumns:
20+
- jsonPath: .status.phase
21+
name: Phase
22+
type: string
23+
name: v1alpha1
2024
schema:
2125
openAPIV3Schema:
2226
description: ClusterProvider is the Schema for the clusterproviders API.
@@ -160,6 +164,8 @@ spec:
160164
- observedGeneration
161165
type: object
162166
type: object
167+
selectableFields:
168+
- jsonPath: .status.phase
163169
served: true
164170
storage: true
165171
subresources:

api/crds/manifests/openmcp.cloud_platformservices.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ spec:
1616
singular: platformservice
1717
scope: Cluster
1818
versions:
19-
- name: v1alpha1
19+
- additionalPrinterColumns:
20+
- jsonPath: .status.phase
21+
name: Phase
22+
type: string
23+
name: v1alpha1
2024
schema:
2125
openAPIV3Schema:
2226
description: PlatformService is the Schema for the platformservices API.
@@ -160,6 +164,8 @@ spec:
160164
- observedGeneration
161165
type: object
162166
type: object
167+
selectableFields:
168+
- jsonPath: .status.phase
163169
served: true
164170
storage: true
165171
subresources:

api/crds/manifests/openmcp.cloud_serviceproviders.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ spec:
1616
singular: serviceprovider
1717
scope: Cluster
1818
versions:
19-
- name: v1alpha1
19+
- additionalPrinterColumns:
20+
- jsonPath: .status.phase
21+
name: Phase
22+
type: string
23+
name: v1alpha1
2024
schema:
2125
openAPIV3Schema:
2226
description: ServiceProvider is the Schema for the serviceproviders API.
@@ -160,6 +164,8 @@ spec:
160164
- observedGeneration
161165
type: object
162166
type: object
167+
selectableFields:
168+
- jsonPath: .status.phase
163169
served: true
164170
storage: true
165171
subresources:

api/provider/v1alpha1/clusterprovider_types.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ type ClusterProviderStatus struct {
3838
// +kubebuilder:subresource:status
3939
// +kubebuilder:resource:scope=Cluster
4040
// +kubebuilder:metadata:labels="openmcp.cloud/cluster=platform"
41+
// +kubebuilder:selectablefield:JSONPath=".status.phase"
42+
// +kubebuilder:printcolumn:JSONPath=".status.phase",name="Phase",type=string
4143

4244
// ClusterProvider is the Schema for the clusterproviders API.
4345
type ClusterProvider struct {

api/provider/v1alpha1/platformservice_types.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ type PlatformServiceStatus struct {
3838
// +kubebuilder:subresource:status
3939
// +kubebuilder:resource:scope=Cluster
4040
// +kubebuilder:metadata:labels="openmcp.cloud/cluster=platform"
41+
// +kubebuilder:selectablefield:JSONPath=".status.phase"
42+
// +kubebuilder:printcolumn:JSONPath=".status.phase",name="Phase",type=string
4143

4244
// PlatformService is the Schema for the platformservices API.
4345
type PlatformService struct {

api/provider/v1alpha1/serviceprovider_types.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ type ServiceProviderStatus struct {
3838
// +kubebuilder:subresource:status
3939
// +kubebuilder:resource:scope=Cluster
4040
// +kubebuilder:metadata:labels="openmcp.cloud/cluster=platform"
41+
// +kubebuilder:selectablefield:JSONPath=".status.phase"
42+
// +kubebuilder:printcolumn:JSONPath=".status.phase",name="Phase",type=string
4143

4244
// ServiceProvider is the Schema for the serviceproviders API.
4345
type ServiceProvider struct {

cmd/openmcp-operator/app/run.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -312,9 +312,8 @@ func (o *RunOptions) Run(ctx context.Context) error {
312312
if slices.Contains(o.Controllers, strings.ToLower(provider.ControllerName)) {
313313
utilruntime.Must(clientgoscheme.AddToScheme(mgr.GetScheme()))
314314
utilruntime.Must(api.AddToScheme(mgr.GetScheme()))
315-
316-
if err = provider.NewDeploymentController().SetupWithManager(mgr, o.ProviderGVKList, o.Environment); err != nil {
317-
return fmt.Errorf("unable to setup provider controllers: %w", err)
315+
if err = provider.NewDeploymentController().SetupWithManager(&setupLog, mgr, o.ProviderGVKList, o.Environment); err != nil {
316+
return fmt.Errorf("unable to setup deployment controllers: %w", err)
318317
}
319318
}
320319

internal/controllers/provider/conditions.go

Lines changed: 0 additions & 149 deletions
This file was deleted.

0 commit comments

Comments
 (0)