Skip to content

Commit 9fc1fe7

Browse files
committed
fix(crd): missing shortname and printcolumn
1 parent e4800e0 commit 9fc1fe7

12 files changed

+79
-9
lines changed

api/v2/apisixconsumer_types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ type ApisixConsumerStatus = ApisixStatus
3333

3434
// +kubebuilder:object:root=true
3535
// +kubebuilder:subresource:status
36+
// +kubebuilder:resource:shortName=ac
3637

3738
// ApisixConsumer is the Schema for the apisixconsumers API.
3839
type ApisixConsumer struct {

api/v2/apisixglobalrule_types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ type ApisixGlobalRuleStatus = ApisixStatus
3131

3232
// +kubebuilder:object:root=true
3333
// +kubebuilder:subresource:status
34+
// +kubebuilder:resource:shortName=agr
3435

3536
// ApisixGlobalRule is the Schema for the apisixglobalrules API.
3637
type ApisixGlobalRule struct {

api/v2/apisixpluginconfig_types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ type ApisixPluginConfigStatus = ApisixStatus
3232

3333
// +kubebuilder:object:root=true
3434
// +kubebuilder:subresource:status
35+
// +kubebuilder:resource:shortName=apc
3536

3637
// ApisixPluginConfig is the Schema for the apisixpluginconfigs API.
3738
type ApisixPluginConfig struct {

api/v2/apisixroute_types.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,13 @@ type ApisixRouteStatus = ApisixStatus
3535

3636
// +kubebuilder:object:root=true
3737
// +kubebuilder:subresource:status
38+
// +kubebuilder:resource:shortName=ar
39+
// +kubebuilder:printcolumn:name="Hosts",type="string",JSONPath=".spec.http[].match.hosts",description="HTTP Hosts",priority=0
40+
// +kubebuilder:printcolumn:name="URIs",type="string",JSONPath=".spec.http[].match.paths",description="HTTP Paths",priority=0
41+
// +kubebuilder:printcolumn:name="Target Service (HTTP)",type="string",JSONPath=".spec.http[].backends[].serviceName",description="Backend Service for HTTP",priority=1
42+
// +kubebuilder:printcolumn:name="Ingress Port (TCP)",type="integer",JSONPath=".spec.tcp[].match.ingressPort",description="TCP Ingress Port",priority=1
43+
// +kubebuilder:printcolumn:name="Target Service (TCP)",type="string",JSONPath=".spec.tcp[].match.backend.serviceName",description="Backend Service for TCP",priority=1
44+
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Creation time",priority=0
3845

3946
// ApisixRoute is the Schema for the apisixroutes API.
4047
type ApisixRoute struct {

api/v2/apisixtls_types.go

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,13 @@ type ApisixTlsStatus = ApisixStatus
3737
// +kubebuilder:object:root=true
3838
// +kubebuilder:subresource:status
3939
// +kubebuilder:resource:shortName=atls
40+
// +kubebuilder:object:root=true
41+
// +kubebuilder:printcolumn:name="SNIs",type=string,JSONPath=`.spec.hosts`
42+
// +kubebuilder:printcolumn:name="Secret Name",type=string,JSONPath=`.spec.secret.name`
43+
// +kubebuilder:printcolumn:name="Secret Namespace",type=string,JSONPath=`.spec.secret.namespace`
44+
// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`
45+
// +kubebuilder:printcolumn:name="Client CA Secret Name",type=string,JSONPath=`.spec.client.ca.name`
46+
// +kubebuilder:printcolumn:name="Client CA Secret Namespace",type=string,JSONPath=`.spec.client.ca.namespace`
4047

4148
// ApisixTls is the Schema for the apisixtls API.
4249
type ApisixTls struct {
@@ -47,14 +54,9 @@ type ApisixTls struct {
4754
Status ApisixTlsStatus `json:"status,omitempty"`
4855
}
4956

50-
// ApisixTlsList contains a list of ApisixTls.
5157
// +kubebuilder:object:root=true
52-
// +kubebuilder:printcolumn:name="SNIs",type=string,JSONPath=`.spec.hosts`
53-
// +kubebuilder:printcolumn:name="Secret Name",type=string,JSONPath=`.spec.secret.name`
54-
// +kubebuilder:printcolumn:name="Secret Namespace",type=string,JSONPath=`.spec.secret.namespace`
55-
// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`
56-
// +kubebuilder:printcolumn:name="Client CA Secret Name",type=string,JSONPath=`.spec.client.ca.name`
57-
// +kubebuilder:printcolumn:name="Client CA Secret Namespace",type=string,JSONPath=`.spec.client.ca.namespace`
58+
59+
// ApisixTlsList contains a list of ApisixTls.
5860
type ApisixTlsList struct {
5961
metav1.TypeMeta `json:",inline"`
6062
metav1.ListMeta `json:"metadata,omitempty"`

api/v2/apisixupstream_types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ type ApisixUpstreamStatus = ApisixStatus
4242

4343
// +kubebuilder:object:root=true
4444
// +kubebuilder:subresource:status
45+
// +kubebuilder:resource:shortName=au
4546

4647
// ApisixUpstream is the Schema for the apisixupstreams API.
4748
type ApisixUpstream struct {

config/crd/bases/apisix.apache.org_apisixconsumers.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ spec:
1111
kind: ApisixConsumer
1212
listKind: ApisixConsumerList
1313
plural: apisixconsumers
14+
shortNames:
15+
- ac
1416
singular: apisixconsumer
1517
scope: Namespaced
1618
versions:

config/crd/bases/apisix.apache.org_apisixglobalrules.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ spec:
1111
kind: ApisixGlobalRule
1212
listKind: ApisixGlobalRuleList
1313
plural: apisixglobalrules
14+
shortNames:
15+
- agr
1416
singular: apisixglobalrule
1517
scope: Namespaced
1618
versions:

config/crd/bases/apisix.apache.org_apisixpluginconfigs.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ spec:
1111
kind: ApisixPluginConfig
1212
listKind: ApisixPluginConfigList
1313
plural: apisixpluginconfigs
14+
shortNames:
15+
- apc
1416
singular: apisixpluginconfig
1517
scope: Namespaced
1618
versions:

config/crd/bases/apisix.apache.org_apisixroutes.yaml

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,40 @@ spec:
1111
kind: ApisixRoute
1212
listKind: ApisixRouteList
1313
plural: apisixroutes
14+
shortNames:
15+
- ar
1416
singular: apisixroute
1517
scope: Namespaced
1618
versions:
17-
- name: v2
19+
- additionalPrinterColumns:
20+
- description: HTTP Hosts
21+
jsonPath: .spec.http[].match.hosts
22+
name: Hosts
23+
type: string
24+
- description: HTTP Paths
25+
jsonPath: .spec.http[].match.paths
26+
name: URIs
27+
type: string
28+
- description: Backend Service for HTTP
29+
jsonPath: .spec.http[].backends[].serviceName
30+
name: Target Service (HTTP)
31+
priority: 1
32+
type: string
33+
- description: TCP Ingress Port
34+
jsonPath: .spec.tcp[].match.ingressPort
35+
name: Ingress Port (TCP)
36+
priority: 1
37+
type: integer
38+
- description: Backend Service for TCP
39+
jsonPath: .spec.tcp[].match.backend.serviceName
40+
name: Target Service (TCP)
41+
priority: 1
42+
type: string
43+
- description: Creation time
44+
jsonPath: .metadata.creationTimestamp
45+
name: Age
46+
type: date
47+
name: v2
1848
schema:
1949
openAPIV3Schema:
2050
description: ApisixRoute is the Schema for the apisixroutes API.

0 commit comments

Comments
 (0)