Skip to content

Commit

Permalink
add custom columns to "kubectl get" output for liqo CRDs
Browse files Browse the repository at this point in the history
  • Loading branch information
alacuku committed Jul 14, 2021
1 parent d397a05 commit 51aca8a
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 7 deletions.
2 changes: 2 additions & 0 deletions apis/discovery/v1alpha1/resourcerequest_types.go
Expand Up @@ -34,6 +34,8 @@ type ResourceRequestStatus struct {
// +kubebuilder:subresource:status

// ResourceRequest is the Schema for the ResourceRequests API.
// +kubebuilder:printcolumn:name="Local",type=string,JSONPath=`.metadata.labels.liqo\.io/replication`
// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`
type ResourceRequest struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand Down
6 changes: 6 additions & 0 deletions apis/net/v1alpha1/networkconfig_types.go
Expand Up @@ -64,6 +64,12 @@ type NetworkConfigStatus struct {
// +kubebuilder:subresource:status

// NetworkConfig is the Schema for the networkconfigs API.
// +kubebuilder:printcolumn:name="Peering Cluster ID",type=string,JSONPath=`.spec.clusterID`
// +kubebuilder:printcolumn:name="Endpoint IP",type=string,JSONPath=`.spec.endpointIP`,priority=1
// +kubebuilder:printcolumn:name="VPN Backend",type=string,JSONPath=`.spec.backendType`,priority=1
// +kubebuilder:printcolumn:name="Processed",type=string,JSONPath=`.status.processed`
// +kubebuilder:printcolumn:name="Local",type=string,JSONPath=`.metadata.labels.liqo\.io/replication`
// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`
type NetworkConfig struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand Down
4 changes: 3 additions & 1 deletion apis/net/v1alpha1/tunnel_endpoint_types.go
Expand Up @@ -96,9 +96,11 @@ const (
// +kubebuilder:subresource:status

// TunnelEndpoint is the Schema for the endpoints API.
// +kubebuilder:printcolumn:name="Endpoint IP",type=string,JSONPath=`.spec.endpointIP`
// +kubebuilder:printcolumn:name="Peering Cluster ID",type=string,JSONPath=`.spec.clusterID`
// +kubebuilder:printcolumn:name="Endpoint IP",type=string,JSONPath=`.spec.endpointIP`,priority=1
// +kubebuilder:printcolumn:name="Backend type",type=string,JSONPath=`.spec.backendType`
// +kubebuilder:printcolumn:name="Connection status",type=string,JSONPath=`.status.connection.status`
// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`
type TunnelEndpoint struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand Down
2 changes: 1 addition & 1 deletion apis/sharing/v1alpha1/resourceoffer_types.go
Expand Up @@ -73,8 +73,8 @@ type ResourceOfferStatus struct {

// ResourceOffer is the Schema for the resourceOffers API.
// +kubebuilder:printcolumn:name="Status",type=string,JSONPath=`.status.phase`
// +kubebuilder:printcolumn:name="Expiration",type=string,JSONPath=`.spec.timeToLive`
// +kubebuilder:printcolumn:name="VirtualKubeletStatus",type=string,JSONPath=`.status.virtualKubeletStatus`
// +kubebuilder:printcolumn:name="Local",type=string,JSONPath=`.metadata.labels.liqo\.io/replication`
// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`
type ResourceOffer struct {
metav1.TypeMeta `json:",inline"`
Expand Down
Expand Up @@ -16,7 +16,14 @@ spec:
singular: resourcerequest
scope: Namespaced
versions:
- name: v1alpha1
- additionalPrinterColumns:
- jsonPath: .metadata.labels.liqo\.io/replication
name: Local
type: string
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1alpha1
schema:
openAPIV3Schema:
description: ResourceRequest is the Schema for the ResourceRequests API.
Expand Down
23 changes: 22 additions & 1 deletion deployments/liqo/crds/net.liqo.io_networkconfigs.yaml
Expand Up @@ -16,7 +16,28 @@ spec:
singular: networkconfig
scope: Namespaced
versions:
- name: v1alpha1
- additionalPrinterColumns:
- jsonPath: .spec.clusterID
name: Peering Cluster ID
type: string
- jsonPath: .spec.endpointIP
name: Endpoint IP
priority: 1
type: string
- jsonPath: .spec.backendType
name: VPN Backend
priority: 1
type: string
- jsonPath: .status.processed
name: Processed
type: string
- jsonPath: .metadata.labels.liqo\.io/replication
name: Local
type: string
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1alpha1
schema:
openAPIV3Schema:
description: NetworkConfig is the Schema for the networkconfigs API.
Expand Down
7 changes: 7 additions & 0 deletions deployments/liqo/crds/net.liqo.io_tunnelendpoints.yaml
Expand Up @@ -17,15 +17,22 @@ spec:
scope: Namespaced
versions:
- additionalPrinterColumns:
- jsonPath: .spec.clusterID
name: Peering Cluster ID
type: string
- jsonPath: .spec.endpointIP
name: Endpoint IP
priority: 1
type: string
- jsonPath: .spec.backendType
name: Backend type
type: string
- jsonPath: .status.connection.status
name: Connection status
type: string
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1alpha1
schema:
openAPIV3Schema:
Expand Down
6 changes: 3 additions & 3 deletions deployments/liqo/crds/sharing.liqo.io_resourceoffers.yaml
Expand Up @@ -22,12 +22,12 @@ spec:
- jsonPath: .status.phase
name: Status
type: string
- jsonPath: .spec.timeToLive
name: Expiration
type: string
- jsonPath: .status.virtualKubeletStatus
name: VirtualKubeletStatus
type: string
- jsonPath: .metadata.labels.liqo\.io/replication
name: Local
type: string
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
Expand Down

0 comments on commit 51aca8a

Please sign in to comment.