Skip to content

Commit db8f23c

Browse files
committed
Add short names and printer columns
Signed-off-by: Surya Seetharaman <[email protected]>
1 parent 66de9e4 commit db8f23c

File tree

4 files changed

+24
-7
lines changed

4 files changed

+24
-7
lines changed

apis/v1alpha1/adminnetworkpolicy_types.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@ import (
2626
// +genclient
2727
// +kubebuilder:object:root=true
2828
// +kubebuilder:subresource:status
29-
// +kubebuilder:resource:scope=Cluster
29+
// +kubebuilder:resource:shortName=anp,scope=Cluster
30+
// +kubebuilder:printcolumn:name="Priority",type=string,JSONPath=".spec.priority"
31+
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
3032
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
31-
3233
// AdminNetworkPolicy is a cluster level resource that is part of the
3334
// AdminNetworkPolicy API.
3435
type AdminNetworkPolicy struct {

apis/v1alpha1/baselineadminnetworkpolicy_types.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ import (
2222
// +genclient
2323
// +kubebuilder:object:root=true
2424
// +kubebuilder:subresource:status
25-
// +kubebuilder:resource:scope=Cluster
25+
// +kubebuilder:resource:shortName=banp,scope=Cluster
26+
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
2627
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
2728

2829
// BaselineAdminNetworkPolicy is a cluster level resource that is part of the

config/crd/bases/policy.networking.k8s.io_adminnetworkpolicies.yaml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,19 @@ spec:
1212
kind: AdminNetworkPolicy
1313
listKind: AdminNetworkPolicyList
1414
plural: adminnetworkpolicies
15+
shortNames:
16+
- anp
1517
singular: adminnetworkpolicy
1618
scope: Cluster
1719
versions:
18-
- name: v1alpha1
20+
- additionalPrinterColumns:
21+
- jsonPath: .spec.priority
22+
name: Priority
23+
type: string
24+
- jsonPath: .metadata.creationTimestamp
25+
name: Age
26+
type: date
27+
name: v1alpha1
1928
schema:
2029
openAPIV3Schema:
2130
description: AdminNetworkPolicy is a cluster level resource that is part

config/crd/bases/policy.networking.k8s.io_baselineadminnetworkpolicies.yaml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,16 @@ spec:
1212
kind: BaselineAdminNetworkPolicy
1313
listKind: BaselineAdminNetworkPolicyList
1414
plural: baselineadminnetworkpolicies
15+
shortNames:
16+
- banp
1517
singular: baselineadminnetworkpolicy
1618
scope: Cluster
1719
versions:
18-
- name: v1alpha1
20+
- additionalPrinterColumns:
21+
- jsonPath: .metadata.creationTimestamp
22+
name: Age
23+
type: date
24+
name: v1alpha1
1925
schema:
2026
openAPIV3Schema:
2127
description: BaselineAdminNetworkPolicy is a cluster level resource that is
@@ -43,8 +49,8 @@ spec:
4349
in each BANP instance. BANPs with no egress rules do not affect
4450
egress traffic.
4551
items:
46-
description: AdminNetworkPolicyEgressRule describes an action to
47-
take on a particular set of traffic originating from pods selected
52+
description: BaselineAdminNetworkPolicyEgressRule describes an action
53+
to take on a particular set of traffic originating from pods selected
4854
by a BaselineAdminNetworkPolicy's Subject field.
4955
properties:
5056
action:

0 commit comments

Comments
 (0)