From e0d73b33c79d18cca95149004cb2a6789d0306ea Mon Sep 17 00:00:00 2001 From: Rob Scott Date: Fri, 19 Mar 2021 14:45:29 -0700 Subject: [PATCH] Adding gateway-api category and age column to CRDs --- apis/v1alpha1/backendpolicy_types.go | 3 ++- apis/v1alpha1/gateway_types.go | 3 ++- apis/v1alpha1/gatewayclass_types.go | 3 ++- apis/v1alpha1/httproute_types.go | 2 ++ apis/v1alpha1/tcproute_types.go | 2 ++ apis/v1alpha1/tlsroute_types.go | 2 ++ apis/v1alpha1/udproute_types.go | 2 ++ config/crd/bases/networking.x-k8s.io_backendpolicies.yaml | 8 +++++++- config/crd/bases/networking.x-k8s.io_gatewayclasses.yaml | 5 +++++ config/crd/bases/networking.x-k8s.io_gateways.yaml | 5 +++++ config/crd/bases/networking.x-k8s.io_httproutes.yaml | 5 +++++ config/crd/bases/networking.x-k8s.io_tcproutes.yaml | 8 +++++++- config/crd/bases/networking.x-k8s.io_tlsroutes.yaml | 8 +++++++- config/crd/bases/networking.x-k8s.io_udproutes.yaml | 8 +++++++- 14 files changed, 57 insertions(+), 7 deletions(-) diff --git a/apis/v1alpha1/backendpolicy_types.go b/apis/v1alpha1/backendpolicy_types.go index c5c073232c..b3f66c9879 100644 --- a/apis/v1alpha1/backendpolicy_types.go +++ b/apis/v1alpha1/backendpolicy_types.go @@ -22,8 +22,9 @@ import ( // +genclient // +kubebuilder:object:root=true -// +kubebuilder:resource:shortName=bp +// +kubebuilder:resource:categories=gateway-api,shortName=bp // +kubebuilder:subresource:status +// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp` // BackendPolicy defines policies associated with backends. For the purpose of // this API, a backend is defined as any resource that a route can forward diff --git a/apis/v1alpha1/gateway_types.go b/apis/v1alpha1/gateway_types.go index ae1a152f49..d32430da86 100644 --- a/apis/v1alpha1/gateway_types.go +++ b/apis/v1alpha1/gateway_types.go @@ -22,9 +22,10 @@ import ( // +genclient // +kubebuilder:object:root=true -// +kubebuilder:resource:shortName=gtw +// +kubebuilder:resource:categories=gateway-api,shortName=gtw // +kubebuilder:subresource:status // +kubebuilder:printcolumn:name="Class",type=string,JSONPath=`.spec.gatewayClassName` +// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp` // Gateway represents an instantiation of a service-traffic handling // infrastructure by binding Listeners to a set of IP addresses. diff --git a/apis/v1alpha1/gatewayclass_types.go b/apis/v1alpha1/gatewayclass_types.go index 0eb55d6b94..38349b3df1 100644 --- a/apis/v1alpha1/gatewayclass_types.go +++ b/apis/v1alpha1/gatewayclass_types.go @@ -23,9 +23,10 @@ import ( // +genclient // +genclient:nonNamespaced // +kubebuilder:object:root=true -// +kubebuilder:resource:scope=Cluster,shortName=gc +// +kubebuilder:resource:categories=gateway-api,scope=Cluster,shortName=gc // +kubebuilder:subresource:status // +kubebuilder:printcolumn:name="Controller",type=string,JSONPath=`.spec.controller` +// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp` // GatewayClass describes a class of Gateways available to the user // for creating Gateway resources. diff --git a/apis/v1alpha1/httproute_types.go b/apis/v1alpha1/httproute_types.go index f169b1df63..b1f2c9c2a6 100644 --- a/apis/v1alpha1/httproute_types.go +++ b/apis/v1alpha1/httproute_types.go @@ -22,8 +22,10 @@ import ( // +genclient // +kubebuilder:object:root=true +// +kubebuilder:resource:categories=gateway-api // +kubebuilder:subresource:status // +kubebuilder:printcolumn:name="Hostnames",type=string,JSONPath=`.spec.hostnames` +// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp` // HTTPRoute is the Schema for the HTTPRoute resource. type HTTPRoute struct { diff --git a/apis/v1alpha1/tcproute_types.go b/apis/v1alpha1/tcproute_types.go index 88dc89a5a2..e66275c419 100644 --- a/apis/v1alpha1/tcproute_types.go +++ b/apis/v1alpha1/tcproute_types.go @@ -22,7 +22,9 @@ import ( // +genclient // +kubebuilder:object:root=true +// +kubebuilder:resource:categories=gateway-api // +kubebuilder:subresource:status +// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp` // TCPRoute is the Schema for the TCPRoute resource. type TCPRoute struct { diff --git a/apis/v1alpha1/tlsroute_types.go b/apis/v1alpha1/tlsroute_types.go index 876877861e..99172252bc 100644 --- a/apis/v1alpha1/tlsroute_types.go +++ b/apis/v1alpha1/tlsroute_types.go @@ -22,7 +22,9 @@ import ( // +genclient // +kubebuilder:object:root=true +// +kubebuilder:resource:categories=gateway-api // +kubebuilder:subresource:status +// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp` // The TLSRoute resource is similar to TCPRoute, but can be configured // to match against TLS-specific metadata. This allows more flexibility diff --git a/apis/v1alpha1/udproute_types.go b/apis/v1alpha1/udproute_types.go index 82ac99928c..bb4ed1a8c5 100644 --- a/apis/v1alpha1/udproute_types.go +++ b/apis/v1alpha1/udproute_types.go @@ -22,7 +22,9 @@ import ( // +genclient // +kubebuilder:object:root=true +// +kubebuilder:resource:categories=gateway-api // +kubebuilder:subresource:status +// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp` // UDPRoute is a resource that specifies how a Gateway should forward UDP traffic. type UDPRoute struct { diff --git a/config/crd/bases/networking.x-k8s.io_backendpolicies.yaml b/config/crd/bases/networking.x-k8s.io_backendpolicies.yaml index 858d54e466..63c246880e 100644 --- a/config/crd/bases/networking.x-k8s.io_backendpolicies.yaml +++ b/config/crd/bases/networking.x-k8s.io_backendpolicies.yaml @@ -10,6 +10,8 @@ metadata: spec: group: networking.x-k8s.io names: + categories: + - gateway-api kind: BackendPolicy listKind: BackendPolicyList plural: backendpolicies @@ -18,7 +20,11 @@ spec: singular: backendpolicy scope: Namespaced versions: - - name: v1alpha1 + - additionalPrinterColumns: + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + name: v1alpha1 schema: openAPIV3Schema: description: BackendPolicy defines policies associated with backends. For the purpose of this API, a backend is defined as any resource that a route can forward traffic to. A common example of a backend is a Service. Configuration that is implementation specific may be represented with similar implementation specific custom resources. diff --git a/config/crd/bases/networking.x-k8s.io_gatewayclasses.yaml b/config/crd/bases/networking.x-k8s.io_gatewayclasses.yaml index cf3b0f1aa6..7b361c70e0 100644 --- a/config/crd/bases/networking.x-k8s.io_gatewayclasses.yaml +++ b/config/crd/bases/networking.x-k8s.io_gatewayclasses.yaml @@ -10,6 +10,8 @@ metadata: spec: group: networking.x-k8s.io names: + categories: + - gateway-api kind: GatewayClass listKind: GatewayClassList plural: gatewayclasses @@ -22,6 +24,9 @@ spec: - jsonPath: .spec.controller name: Controller type: string + - jsonPath: .metadata.creationTimestamp + name: Age + type: date name: v1alpha1 schema: openAPIV3Schema: diff --git a/config/crd/bases/networking.x-k8s.io_gateways.yaml b/config/crd/bases/networking.x-k8s.io_gateways.yaml index 79cd2f9fd8..2421d6b524 100644 --- a/config/crd/bases/networking.x-k8s.io_gateways.yaml +++ b/config/crd/bases/networking.x-k8s.io_gateways.yaml @@ -10,6 +10,8 @@ metadata: spec: group: networking.x-k8s.io names: + categories: + - gateway-api kind: Gateway listKind: GatewayList plural: gateways @@ -22,6 +24,9 @@ spec: - jsonPath: .spec.gatewayClassName name: Class type: string + - jsonPath: .metadata.creationTimestamp + name: Age + type: date name: v1alpha1 schema: openAPIV3Schema: diff --git a/config/crd/bases/networking.x-k8s.io_httproutes.yaml b/config/crd/bases/networking.x-k8s.io_httproutes.yaml index 6fdab9c584..7d972acd3d 100644 --- a/config/crd/bases/networking.x-k8s.io_httproutes.yaml +++ b/config/crd/bases/networking.x-k8s.io_httproutes.yaml @@ -10,6 +10,8 @@ metadata: spec: group: networking.x-k8s.io names: + categories: + - gateway-api kind: HTTPRoute listKind: HTTPRouteList plural: httproutes @@ -20,6 +22,9 @@ spec: - jsonPath: .spec.hostnames name: Hostnames type: string + - jsonPath: .metadata.creationTimestamp + name: Age + type: date name: v1alpha1 schema: openAPIV3Schema: diff --git a/config/crd/bases/networking.x-k8s.io_tcproutes.yaml b/config/crd/bases/networking.x-k8s.io_tcproutes.yaml index 9a76314202..0b285c99de 100644 --- a/config/crd/bases/networking.x-k8s.io_tcproutes.yaml +++ b/config/crd/bases/networking.x-k8s.io_tcproutes.yaml @@ -10,13 +10,19 @@ metadata: spec: group: networking.x-k8s.io names: + categories: + - gateway-api kind: TCPRoute listKind: TCPRouteList plural: tcproutes singular: tcproute scope: Namespaced versions: - - name: v1alpha1 + - additionalPrinterColumns: + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + name: v1alpha1 schema: openAPIV3Schema: description: TCPRoute is the Schema for the TCPRoute resource. diff --git a/config/crd/bases/networking.x-k8s.io_tlsroutes.yaml b/config/crd/bases/networking.x-k8s.io_tlsroutes.yaml index 17cffbb80c..73eab9bff6 100644 --- a/config/crd/bases/networking.x-k8s.io_tlsroutes.yaml +++ b/config/crd/bases/networking.x-k8s.io_tlsroutes.yaml @@ -10,13 +10,19 @@ metadata: spec: group: networking.x-k8s.io names: + categories: + - gateway-api kind: TLSRoute listKind: TLSRouteList plural: tlsroutes singular: tlsroute scope: Namespaced versions: - - name: v1alpha1 + - additionalPrinterColumns: + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + name: v1alpha1 schema: openAPIV3Schema: description: "The TLSRoute resource is similar to TCPRoute, but can be configured to match against TLS-specific metadata. This allows more flexibility in matching streams for a given TLS listener. \n If you need to forward traffic to a single target for a TLS listener, you could choose to use a TCPRoute with a TLS listener." diff --git a/config/crd/bases/networking.x-k8s.io_udproutes.yaml b/config/crd/bases/networking.x-k8s.io_udproutes.yaml index 2d462b197c..d9165e0f72 100644 --- a/config/crd/bases/networking.x-k8s.io_udproutes.yaml +++ b/config/crd/bases/networking.x-k8s.io_udproutes.yaml @@ -10,13 +10,19 @@ metadata: spec: group: networking.x-k8s.io names: + categories: + - gateway-api kind: UDPRoute listKind: UDPRouteList plural: udproutes singular: udproute scope: Namespaced versions: - - name: v1alpha1 + - additionalPrinterColumns: + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + name: v1alpha1 schema: openAPIV3Schema: description: UDPRoute is a resource that specifies how a Gateway should forward UDP traffic.