Skip to content

Commit

Permalink
Add CRDs printcolumns (#353)
Browse files Browse the repository at this point in the history
  • Loading branch information
grzpiotrowski authored Dec 13, 2023
1 parent 5ab0be7 commit 0355953
Show file tree
Hide file tree
Showing 9 changed files with 108 additions and 6 deletions.
2 changes: 2 additions & 0 deletions api/v1beta1/kuadrant_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ func (r *KuadrantStatus) Equals(other *KuadrantStatus, logger logr.Logger) bool

//+kubebuilder:object:root=true
//+kubebuilder:subresource:status
//+kubebuilder:printcolumn:name="Status",type=string,JSONPath=`.status.conditions[0].reason`,priority=2
//+kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"

// Kuadrant configures installations of Kuadrant Service Protection components
type Kuadrant struct {
Expand Down
4 changes: 4 additions & 0 deletions api/v1beta2/authpolicy_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,10 @@ func (s *AuthPolicyStatus) Equals(other *AuthPolicyStatus, logger logr.Logger) b
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:metadata:labels="gateway.networking.k8s.io/policy=direct"
// +kubebuilder:printcolumn:name="Status",type=string,JSONPath=`.status.conditions[0].reason`,description="AuthPolicy Status",priority=2
// +kubebuilder:printcolumn:name="TargetRefKind",type="string",JSONPath=".spec.targetRef.kind",description="Type of the referenced Gateway API resource",priority=2
// +kubebuilder:printcolumn:name="TargetRefName",type="string",JSONPath=".spec.targetRef.name",description="Name of the referenced Gateway API resource",priority=2
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"

// AuthPolicy enables authentication and authorization for service workloads in a Gateway API network
type AuthPolicy struct {
Expand Down
4 changes: 4 additions & 0 deletions api/v1beta2/ratelimitpolicy_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,10 @@ func (s *RateLimitPolicyStatus) Equals(other *RateLimitPolicyStatus, logger logr
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:metadata:labels="gateway.networking.k8s.io/policy=direct"
// +kubebuilder:printcolumn:name="Status",type=string,JSONPath=`.status.conditions[0].reason`,description="RateLimitPolicy Status",priority=2
// +kubebuilder:printcolumn:name="TargetRefKind",type="string",JSONPath=".spec.targetRef.kind",description="Type of the referenced Gateway API resource",priority=2
// +kubebuilder:printcolumn:name="TargetRefName",type="string",JSONPath=".spec.targetRef.name",description="Name of the referenced Gateway API resource",priority=2
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"

// RateLimitPolicy enables rate limiting for service workloads in a Gateway API network
type RateLimitPolicy struct {
Expand Down
21 changes: 20 additions & 1 deletion bundle/manifests/kuadrant.io_authpolicies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,26 @@ spec:
singular: authpolicy
scope: Namespaced
versions:
- name: v1beta2
- additionalPrinterColumns:
- description: AuthPolicy Status
jsonPath: .status.conditions[0].reason
name: Status
priority: 2
type: string
- description: Type of the referenced Gateway API resource
jsonPath: .spec.targetRef.kind
name: TargetRefKind
priority: 2
type: string
- description: Name of the referenced Gateway API resource
jsonPath: .spec.targetRef.name
name: TargetRefName
priority: 2
type: string
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1beta2
schema:
openAPIV3Schema:
description: AuthPolicy enables authentication and authorization for service
Expand Down
10 changes: 9 additions & 1 deletion bundle/manifests/kuadrant.io_kuadrants.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,15 @@ spec:
singular: kuadrant
scope: Namespaced
versions:
- name: v1beta1
- additionalPrinterColumns:
- jsonPath: .status.conditions[0].reason
name: Status
priority: 2
type: string
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1beta1
schema:
openAPIV3Schema:
description: Kuadrant configures installations of Kuadrant Service Protection
Expand Down
21 changes: 20 additions & 1 deletion bundle/manifests/kuadrant.io_ratelimitpolicies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,26 @@ spec:
singular: ratelimitpolicy
scope: Namespaced
versions:
- name: v1beta2
- additionalPrinterColumns:
- description: RateLimitPolicy Status
jsonPath: .status.conditions[0].reason
name: Status
priority: 2
type: string
- description: Type of the referenced Gateway API resource
jsonPath: .spec.targetRef.kind
name: TargetRefKind
priority: 2
type: string
- description: Name of the referenced Gateway API resource
jsonPath: .spec.targetRef.name
name: TargetRefName
priority: 2
type: string
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1beta2
schema:
openAPIV3Schema:
description: RateLimitPolicy enables rate limiting for service workloads in
Expand Down
21 changes: 20 additions & 1 deletion config/crd/bases/kuadrant.io_authpolicies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,26 @@ spec:
singular: authpolicy
scope: Namespaced
versions:
- name: v1beta2
- additionalPrinterColumns:
- description: AuthPolicy Status
jsonPath: .status.conditions[0].reason
name: Status
priority: 2
type: string
- description: Type of the referenced Gateway API resource
jsonPath: .spec.targetRef.kind
name: TargetRefKind
priority: 2
type: string
- description: Name of the referenced Gateway API resource
jsonPath: .spec.targetRef.name
name: TargetRefName
priority: 2
type: string
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1beta2
schema:
openAPIV3Schema:
description: AuthPolicy enables authentication and authorization for service
Expand Down
10 changes: 9 additions & 1 deletion config/crd/bases/kuadrant.io_kuadrants.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,15 @@ spec:
singular: kuadrant
scope: Namespaced
versions:
- name: v1beta1
- additionalPrinterColumns:
- jsonPath: .status.conditions[0].reason
name: Status
priority: 2
type: string
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1beta1
schema:
openAPIV3Schema:
description: Kuadrant configures installations of Kuadrant Service Protection
Expand Down
21 changes: 20 additions & 1 deletion config/crd/bases/kuadrant.io_ratelimitpolicies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,26 @@ spec:
singular: ratelimitpolicy
scope: Namespaced
versions:
- name: v1beta2
- additionalPrinterColumns:
- description: RateLimitPolicy Status
jsonPath: .status.conditions[0].reason
name: Status
priority: 2
type: string
- description: Type of the referenced Gateway API resource
jsonPath: .spec.targetRef.kind
name: TargetRefKind
priority: 2
type: string
- description: Name of the referenced Gateway API resource
jsonPath: .spec.targetRef.name
name: TargetRefName
priority: 2
type: string
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1beta2
schema:
openAPIV3Schema:
description: RateLimitPolicy enables rate limiting for service workloads in
Expand Down

0 comments on commit 0355953

Please sign in to comment.