Skip to content

Commit 2647195

Browse files
authored
fix(crd): missing shortname and printcolumn (#184)
1 parent 6ed122e commit 2647195

12 files changed

+78
-9
lines changed

api/v2/apisixconsumer_types.go

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

3939
// +kubebuilder:object:root=true
4040
// +kubebuilder:subresource:status
41+
// +kubebuilder:resource:shortName=ac
4142

4243
// ApisixConsumer is the Schema for the apisixconsumers API.
4344
type ApisixConsumer struct {

api/v2/apisixglobalrule_types.go

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

3737
// +kubebuilder:object:root=true
3838
// +kubebuilder:subresource:status
39+
// +kubebuilder:resource:shortName=agr
3940

4041
// ApisixGlobalRule is the Schema for the apisixglobalrules API.
4142
type ApisixGlobalRule struct {

api/v2/apisixpluginconfig_types.go

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

3838
// +kubebuilder:object:root=true
3939
// +kubebuilder:subresource:status
40+
// +kubebuilder:resource:shortName=apc
4041

4142
// ApisixPluginConfig is the Schema for the apisixpluginconfigs API.
4243
type ApisixPluginConfig struct {

api/v2/apisixroute_types.go

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

4141
// +kubebuilder:object:root=true
4242
// +kubebuilder:subresource:status
43+
// +kubebuilder:resource:shortName=ar
44+
// +kubebuilder:printcolumn:name="Hosts",type="string",JSONPath=".spec.http[].match.hosts",description="HTTP Hosts",priority=0
45+
// +kubebuilder:printcolumn:name="URIs",type="string",JSONPath=".spec.http[].match.paths",description="HTTP Paths",priority=0
46+
// +kubebuilder:printcolumn:name="Target Service (HTTP)",type="string",JSONPath=".spec.http[].backends[].serviceName",description="Backend Service for HTTP",priority=1
47+
// +kubebuilder:printcolumn:name="Ingress Port (TCP)",type="integer",JSONPath=".spec.tcp[].match.ingressPort",description="TCP Ingress Port",priority=1
48+
// +kubebuilder:printcolumn:name="Target Service (TCP)",type="string",JSONPath=".spec.tcp[].match.backend.serviceName",description="Backend Service for TCP",priority=1
49+
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Creation time",priority=0
4350

4451
// ApisixRoute is the Schema for the apisixroutes API.
4552
type ApisixRoute struct {

api/v2/apisixtls_types.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ type ApisixTlsStatus = ApisixStatus
4242
// +kubebuilder:object:root=true
4343
// +kubebuilder:subresource:status
4444
// +kubebuilder:resource:shortName=atls,path=apisixtlses
45+
// +kubebuilder:printcolumn:name="SNIs",type=string,JSONPath=`.spec.hosts`
46+
// +kubebuilder:printcolumn:name="Secret Name",type=string,JSONPath=`.spec.secret.name`
47+
// +kubebuilder:printcolumn:name="Secret Namespace",type=string,JSONPath=`.spec.secret.namespace`
48+
// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`
49+
// +kubebuilder:printcolumn:name="Client CA Secret Name",type=string,JSONPath=`.spec.client.ca.name`
50+
// +kubebuilder:printcolumn:name="Client CA Secret Namespace",type=string,JSONPath=`.spec.client.ca.namespace`
4551

4652
// ApisixTls is the Schema for the apisixtls API.
4753
type ApisixTls struct {
@@ -52,14 +58,9 @@ type ApisixTls struct {
5258
Status ApisixTlsStatus `json:"status,omitempty"`
5359
}
5460

55-
// ApisixTlsList contains a list of ApisixTls.
5661
// +kubebuilder:object:root=true
57-
// +kubebuilder:printcolumn:name="SNIs",type=string,JSONPath=`.spec.hosts`
58-
// +kubebuilder:printcolumn:name="Secret Name",type=string,JSONPath=`.spec.secret.name`
59-
// +kubebuilder:printcolumn:name="Secret Namespace",type=string,JSONPath=`.spec.secret.namespace`
60-
// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`
61-
// +kubebuilder:printcolumn:name="Client CA Secret Name",type=string,JSONPath=`.spec.client.ca.name`
62-
// +kubebuilder:printcolumn:name="Client CA Secret Namespace",type=string,JSONPath=`.spec.client.ca.namespace`
62+
63+
// ApisixTlsList contains a list of ApisixTls.
6364
type ApisixTlsList struct {
6465
metav1.TypeMeta `json:",inline"`
6566
metav1.ListMeta `json:"metadata,omitempty"`

api/v2/apisixupstream_types.go

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

4848
// +kubebuilder:object:root=true
4949
// +kubebuilder:subresource:status
50+
// +kubebuilder:resource:shortName=au
5051

5152
// ApisixUpstream is the Schema for the apisixupstreams API.
5253
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)