Skip to content

Commit

Permalink
Add additional columns when listing API Rules on the cluster (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
cnvergence authored Oct 25, 2022
1 parent 8e42d4b commit 236108c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
2 changes: 2 additions & 0 deletions api/v1beta1/apirule_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ type APIRuleStatus struct {
// +kubebuilder:storageversion
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="Status",type="string",JSONPath=".status.APIRuleStatus.code"
// +kubebuilder:printcolumn:name="Host",type="string",JSONPath=".spec.host"
type APIRule struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand Down
17 changes: 12 additions & 5 deletions config/crd/bases/gateway.kyma-project.io_apirules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ spec:
trusted_issuers:
type: array
items:
type: string
pattern: ^(https://|file://).*$
type: string
pattern: ^(https://|file://).*$
handler:
description: Name is the name of a handler
type: string
Expand Down Expand Up @@ -187,7 +187,14 @@ spec:
storage: false
subresources:
status: {}
- name: v1beta1
- additionalPrinterColumns:
- jsonPath: .status.APIRuleStatus.code
name: Status
type: string
- jsonPath: .spec.host
name: Host
type: string
name: v1beta1
schema:
openAPIV3Schema:
description: APIRule is the Schema for the apis ApiRule
Expand Down Expand Up @@ -243,8 +250,8 @@ spec:
trusted_issuers:
type: array
items:
type: string
pattern: ^(https://|file://).*$
type: string
pattern: ^(https://|file://).*$
handler:
description: Name is the name of a handler
type: string
Expand Down

0 comments on commit 236108c

Please sign in to comment.