From eeee41d9521b16263c3f29a9ea2b1876533acf27 Mon Sep 17 00:00:00 2001 From: Andreas Thaler Date: Tue, 1 Oct 2024 18:45:50 +0200 Subject: [PATCH 1/2] feat: Add proper categories for CRDs --- apis/gateway/v1beta1/apirule_types.go | 1 + apis/gateway/v2alpha1/apirule_types.go | 1 + apis/operator/v1alpha1/apigateway_types.go | 2 +- config/crd/bases/gateway.kyma-project.io_apirules.yaml | 3 +++ config/crd/bases/operator.kyma-project.io_apigateways.yaml | 4 ++++ 5 files changed, 10 insertions(+), 1 deletion(-) diff --git a/apis/gateway/v1beta1/apirule_types.go b/apis/gateway/v1beta1/apirule_types.go index 6c5e9395c..6c313524c 100644 --- a/apis/gateway/v1beta1/apirule_types.go +++ b/apis/gateway/v1beta1/apirule_types.go @@ -81,6 +81,7 @@ func (s *APIRuleStatus) ApiRuleStatusVersion() versions.Version { // APIRule is the Schema for ApiRule APIs. // +kubebuilder:storageversion // +kubebuilder:object:root=true +// +kubebuilder:resource:categories={kyma,kyma-api-gateway} // +kubebuilder:subresource:status // +kubebuilder:printcolumn:name="Status",type="string",JSONPath=".status.APIRuleStatus.code" // +kubebuilder:printcolumn:name="Host",type="string",JSONPath=".spec.host" diff --git a/apis/gateway/v2alpha1/apirule_types.go b/apis/gateway/v2alpha1/apirule_types.go index 74834a7b9..ec4d1ce6f 100644 --- a/apis/gateway/v2alpha1/apirule_types.go +++ b/apis/gateway/v2alpha1/apirule_types.go @@ -79,6 +79,7 @@ func (s *APIRuleStatus) ApiRuleStatusVersion() versions.Version { // APIRule is the Schema for ApiRule APIs. // +kubebuilder:object:root=true // +kubebuilder:subresource:status +// +kubebuilder:resource:categories={kyma,kyma-api-gateway} // +kubebuilder:printcolumn:name="Status",type="string",JSONPath=".status.state" // +kubebuilder:printcolumn:name="Hosts",type="string",JSONPath=".spec.hosts" type APIRule struct { diff --git a/apis/operator/v1alpha1/apigateway_types.go b/apis/operator/v1alpha1/apigateway_types.go index 17d405913..61a60f802 100644 --- a/apis/operator/v1alpha1/apigateway_types.go +++ b/apis/operator/v1alpha1/apigateway_types.go @@ -53,7 +53,7 @@ type APIGatewayStatus struct { //+kubebuilder:object:root=true //+kubebuilder:subresource:status //+kubebuilder:printcolumn:JSONPath=".status.state",name="State",type="string" -//+kubebuilder:resource:scope=Cluster +//+kubebuilder:resource:scope=Cluster,categories={kyma,kyma-modules,kyma-api-gateway} // APIGateway is the Schema for the apigateways API type APIGateway struct { diff --git a/config/crd/bases/gateway.kyma-project.io_apirules.yaml b/config/crd/bases/gateway.kyma-project.io_apirules.yaml index 0465c94f6..6ab1e4c2e 100644 --- a/config/crd/bases/gateway.kyma-project.io_apirules.yaml +++ b/config/crd/bases/gateway.kyma-project.io_apirules.yaml @@ -8,6 +8,9 @@ metadata: spec: group: gateway.kyma-project.io names: + categories: + - kyma + - kyma-api-gateway kind: APIRule listKind: APIRuleList plural: apirules diff --git a/config/crd/bases/operator.kyma-project.io_apigateways.yaml b/config/crd/bases/operator.kyma-project.io_apigateways.yaml index 34646c33a..1fb799603 100644 --- a/config/crd/bases/operator.kyma-project.io_apigateways.yaml +++ b/config/crd/bases/operator.kyma-project.io_apigateways.yaml @@ -8,6 +8,10 @@ metadata: spec: group: operator.kyma-project.io names: + categories: + - kyma + - kyma-modules + - kyma-api-gateway kind: APIGateway listKind: APIGatewayList plural: apigateways From 3ec5ee15ecdfda71e5337ad9b99fc42170d25cfe Mon Sep 17 00:00:00 2001 From: Andreas Thaler Date: Wed, 2 Oct 2024 14:43:35 +0200 Subject: [PATCH 2/2] fix --- apis/gateway/v1beta1/apirule_types.go | 2 +- apis/gateway/v2alpha1/apirule_types.go | 2 +- apis/operator/v1alpha1/apigateway_types.go | 2 +- config/crd/bases/gateway.kyma-project.io_apirules.yaml | 1 - config/crd/bases/operator.kyma-project.io_apigateways.yaml | 1 - 5 files changed, 3 insertions(+), 5 deletions(-) diff --git a/apis/gateway/v1beta1/apirule_types.go b/apis/gateway/v1beta1/apirule_types.go index 6c313524c..26312ea63 100644 --- a/apis/gateway/v1beta1/apirule_types.go +++ b/apis/gateway/v1beta1/apirule_types.go @@ -81,7 +81,7 @@ func (s *APIRuleStatus) ApiRuleStatusVersion() versions.Version { // APIRule is the Schema for ApiRule APIs. // +kubebuilder:storageversion // +kubebuilder:object:root=true -// +kubebuilder:resource:categories={kyma,kyma-api-gateway} +// +kubebuilder:resource:categories={kyma-api-gateway} // +kubebuilder:subresource:status // +kubebuilder:printcolumn:name="Status",type="string",JSONPath=".status.APIRuleStatus.code" // +kubebuilder:printcolumn:name="Host",type="string",JSONPath=".spec.host" diff --git a/apis/gateway/v2alpha1/apirule_types.go b/apis/gateway/v2alpha1/apirule_types.go index ec4d1ce6f..a5df26d1a 100644 --- a/apis/gateway/v2alpha1/apirule_types.go +++ b/apis/gateway/v2alpha1/apirule_types.go @@ -79,7 +79,7 @@ func (s *APIRuleStatus) ApiRuleStatusVersion() versions.Version { // APIRule is the Schema for ApiRule APIs. // +kubebuilder:object:root=true // +kubebuilder:subresource:status -// +kubebuilder:resource:categories={kyma,kyma-api-gateway} +// +kubebuilder:resource:categories={kyma-api-gateway} // +kubebuilder:printcolumn:name="Status",type="string",JSONPath=".status.state" // +kubebuilder:printcolumn:name="Hosts",type="string",JSONPath=".spec.hosts" type APIRule struct { diff --git a/apis/operator/v1alpha1/apigateway_types.go b/apis/operator/v1alpha1/apigateway_types.go index 61a60f802..d590d702c 100644 --- a/apis/operator/v1alpha1/apigateway_types.go +++ b/apis/operator/v1alpha1/apigateway_types.go @@ -53,7 +53,7 @@ type APIGatewayStatus struct { //+kubebuilder:object:root=true //+kubebuilder:subresource:status //+kubebuilder:printcolumn:JSONPath=".status.state",name="State",type="string" -//+kubebuilder:resource:scope=Cluster,categories={kyma,kyma-modules,kyma-api-gateway} +//+kubebuilder:resource:scope=Cluster,categories={kyma-modules,kyma-api-gateway} // APIGateway is the Schema for the apigateways API type APIGateway struct { diff --git a/config/crd/bases/gateway.kyma-project.io_apirules.yaml b/config/crd/bases/gateway.kyma-project.io_apirules.yaml index 6ab1e4c2e..c3b947192 100644 --- a/config/crd/bases/gateway.kyma-project.io_apirules.yaml +++ b/config/crd/bases/gateway.kyma-project.io_apirules.yaml @@ -9,7 +9,6 @@ spec: group: gateway.kyma-project.io names: categories: - - kyma - kyma-api-gateway kind: APIRule listKind: APIRuleList diff --git a/config/crd/bases/operator.kyma-project.io_apigateways.yaml b/config/crd/bases/operator.kyma-project.io_apigateways.yaml index 1fb799603..999f63af7 100644 --- a/config/crd/bases/operator.kyma-project.io_apigateways.yaml +++ b/config/crd/bases/operator.kyma-project.io_apigateways.yaml @@ -9,7 +9,6 @@ spec: group: operator.kyma-project.io names: categories: - - kyma - kyma-modules - kyma-api-gateway kind: APIGateway