From e6e830f0e42932881c36779f1496d5dc73bf7809 Mon Sep 17 00:00:00 2001 From: Christopher Dziomba Date: Wed, 18 Oct 2023 11:01:32 +0200 Subject: [PATCH] Add Printer Columns for Layer2 and VRFs --- api/v1alpha1/layer2networkconfiguration_types.go | 4 ++++ api/v1alpha1/vrfrouteconfiguration_types.go | 3 +++ ...f.telekom.de_layer2networkconfigurations.yaml | 16 +++++++++++++++- ...schiff.telekom.de_vrfrouteconfigurations.yaml | 12 +++++++++++- 4 files changed, 33 insertions(+), 2 deletions(-) diff --git a/api/v1alpha1/layer2networkconfiguration_types.go b/api/v1alpha1/layer2networkconfiguration_types.go index f9f6934c..b270f5da 100644 --- a/api/v1alpha1/layer2networkconfiguration_types.go +++ b/api/v1alpha1/layer2networkconfiguration_types.go @@ -72,6 +72,10 @@ type Layer2NetworkConfigurationStatus struct { //+kubebuilder:object:root=true //+kubebuilder:subresource:status //+kubebuilder:resource:shortName=layer2,scope=Cluster +//+kubebuilder:printcolumn:name="VLAN",type=integer,JSONPath=`.spec.id` +//+kubebuilder:printcolumn:name="Gateway",type=string,JSONPath=`.spec.anycastGateways` +//+kubebuilder:printcolumn:name="VRF",type=string,JSONPath=`.spec.vrf` +//+kubebuilder:printcolumn:name="VNI",type=string,JSONPath=`.spec.vni`,priority=10 // Layer2NetworkConfiguration is the Schema for the layer2networkconfigurations API. type Layer2NetworkConfiguration struct { diff --git a/api/v1alpha1/vrfrouteconfiguration_types.go b/api/v1alpha1/vrfrouteconfiguration_types.go index 416a61a0..5b15fac4 100644 --- a/api/v1alpha1/vrfrouteconfiguration_types.go +++ b/api/v1alpha1/vrfrouteconfiguration_types.go @@ -84,6 +84,9 @@ type VRFRouteConfigurationStatus struct { //+kubebuilder:object:root=true //+kubebuilder:subresource:status //+kubebuilder:resource:shortName=vrf,scope=Cluster +//+kubebuilder:printcolumn:name="VRF",type=string,JSONPath=`.spec.vrf` +//+kubebuilder:printcolumn:name="Sequence",type=integer,JSONPath=`.spec.seq` +//+kubebuilder:printcolumn:name="Community",type=string,JSONPath=`.spec.community` // VRFRouteConfiguration is the Schema for the vrfrouteconfigurations API. type VRFRouteConfiguration struct { diff --git a/config/crd/bases/network.schiff.telekom.de_layer2networkconfigurations.yaml b/config/crd/bases/network.schiff.telekom.de_layer2networkconfigurations.yaml index 6d22bd2e..feec7d51 100644 --- a/config/crd/bases/network.schiff.telekom.de_layer2networkconfigurations.yaml +++ b/config/crd/bases/network.schiff.telekom.de_layer2networkconfigurations.yaml @@ -16,7 +16,21 @@ spec: singular: layer2networkconfiguration scope: Cluster versions: - - name: v1alpha1 + - additionalPrinterColumns: + - jsonPath: .spec.id + name: VLAN + type: integer + - jsonPath: .spec.anycastGateways + name: Gateway + type: string + - jsonPath: .spec.vrf + name: VRF + type: string + - jsonPath: .spec.vni + name: VNI + priority: 10 + type: string + name: v1alpha1 schema: openAPIV3Schema: description: Layer2NetworkConfiguration is the Schema for the layer2networkconfigurations diff --git a/config/crd/bases/network.schiff.telekom.de_vrfrouteconfigurations.yaml b/config/crd/bases/network.schiff.telekom.de_vrfrouteconfigurations.yaml index f5096427..4215b498 100644 --- a/config/crd/bases/network.schiff.telekom.de_vrfrouteconfigurations.yaml +++ b/config/crd/bases/network.schiff.telekom.de_vrfrouteconfigurations.yaml @@ -16,7 +16,17 @@ spec: singular: vrfrouteconfiguration scope: Cluster versions: - - name: v1alpha1 + - additionalPrinterColumns: + - jsonPath: .spec.vrf + name: VRF + type: string + - jsonPath: .spec.seq + name: Sequence + type: integer + - jsonPath: .spec.community + name: Community + type: string + name: v1alpha1 schema: openAPIV3Schema: description: VRFRouteConfiguration is the Schema for the vrfrouteconfigurations