From 31e1bb6b095b8bd5d3c84ccdf9458a046c3ce950 Mon Sep 17 00:00:00 2001 From: kashifest Date: Thu, 9 Sep 2021 09:31:42 +0300 Subject: [PATCH] Add AGE column to metal3metal3metal3 CRDs This adds the AGE column to all our CRDs to make the printed output consistent with the built in K8s resources. Keeping things consistent with CAPI# https://github.com/kubernetes-sigs/cluster-api/pull/5180 --- api/v1alpha5/metal3cluster_types.go | 1 + api/v1alpha5/metal3data_types.go | 1 + api/v1alpha5/metal3dataclaim_types.go | 1 + api/v1alpha5/metal3datatemplate_types.go | 1 + api/v1alpha5/metal3machine_types.go | 1 + api/v1alpha5/metal3machinetemplate_types.go | 1 + .../infrastructure.cluster.x-k8s.io_metal3clusters.yaml | 4 ++++ .../infrastructure.cluster.x-k8s.io_metal3dataclaims.yaml | 7 ++++++- .../infrastructure.cluster.x-k8s.io_metal3datas.yaml | 7 ++++++- ...frastructure.cluster.x-k8s.io_metal3datatemplates.yaml | 4 ++++ .../infrastructure.cluster.x-k8s.io_metal3machines.yaml | 4 ++++ ...structure.cluster.x-k8s.io_metal3machinetemplates.yaml | 8 +++++++- 12 files changed, 37 insertions(+), 3 deletions(-) diff --git a/api/v1alpha5/metal3cluster_types.go b/api/v1alpha5/metal3cluster_types.go index 0622476cda..4958c636c6 100644 --- a/api/v1alpha5/metal3cluster_types.go +++ b/api/v1alpha5/metal3cluster_types.go @@ -82,6 +82,7 @@ type Metal3ClusterStatus struct { // +kubebuilder:storageversion // +kubebuilder:subresource:status // +kubebuilder:object:root=true +// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of Metal3Cluster" // +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.ready",description="metal3Cluster is Ready" // +kubebuilder:printcolumn:name="Error",type="string",JSONPath=".status.failureReason",description="Most recent error" // +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".metadata.labels.cluster\\.x-k8s\\.io/cluster-name",description="Cluster to which this BMCluster belongs" diff --git a/api/v1alpha5/metal3data_types.go b/api/v1alpha5/metal3data_types.go index e19ceecffd..a93c5d82f4 100644 --- a/api/v1alpha5/metal3data_types.go +++ b/api/v1alpha5/metal3data_types.go @@ -64,6 +64,7 @@ type Metal3DataStatus struct { // +kubebuilder:storageversion // +kubebuilder:subresource:status // +kubebuilder:object:root=true +// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of Metal3Data" // Metal3Data is the Schema for the metal3datas API type Metal3Data struct { metav1.TypeMeta `json:",inline"` diff --git a/api/v1alpha5/metal3dataclaim_types.go b/api/v1alpha5/metal3dataclaim_types.go index aad0c021e0..3b05a37011 100644 --- a/api/v1alpha5/metal3dataclaim_types.go +++ b/api/v1alpha5/metal3dataclaim_types.go @@ -47,6 +47,7 @@ type Metal3DataClaimStatus struct { // +kubebuilder:storageversion // +kubebuilder:subresource:status // +kubebuilder:object:root=true +// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of Metal3DataClaim" // Metal3DataClaim is the Schema for the metal3datas API type Metal3DataClaim struct { metav1.TypeMeta `json:",inline"` diff --git a/api/v1alpha5/metal3datatemplate_types.go b/api/v1alpha5/metal3datatemplate_types.go index 74c0f25fa3..91f2dc994d 100644 --- a/api/v1alpha5/metal3datatemplate_types.go +++ b/api/v1alpha5/metal3datatemplate_types.go @@ -460,6 +460,7 @@ type Metal3DataTemplateStatus struct { // +kubebuilder:subresource:status // +kubebuilder:object:root=true // +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".metadata.labels.cluster\\.x-k8s\\.io/cluster-name",description="Cluster to which this template belongs" +// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of Metal3DataTemplate" // Metal3DataTemplate is the Schema for the metal3datatemplates API type Metal3DataTemplate struct { diff --git a/api/v1alpha5/metal3machine_types.go b/api/v1alpha5/metal3machine_types.go index 723d219ae1..90bf56b552 100644 --- a/api/v1alpha5/metal3machine_types.go +++ b/api/v1alpha5/metal3machine_types.go @@ -171,6 +171,7 @@ type Metal3MachineStatus struct { // +kubebuilder:object:root=true // +kubebuilder:storageversion // +kubebuilder:subresource:status +// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of Metal3Machine" // +kubebuilder:printcolumn:name="ProviderID",type="string",JSONPath=".spec.providerID",description="Provider ID" // +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.ready",description="metal3machine is Ready" // +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".metadata.labels.cluster\\.x-k8s\\.io/cluster-name",description="Cluster to which this M3Machine belongs" diff --git a/api/v1alpha5/metal3machinetemplate_types.go b/api/v1alpha5/metal3machinetemplate_types.go index 1c7d76dca2..e653974710 100644 --- a/api/v1alpha5/metal3machinetemplate_types.go +++ b/api/v1alpha5/metal3machinetemplate_types.go @@ -33,6 +33,7 @@ type Metal3MachineTemplateSpec struct { // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +kubebuilder:object:root=true +// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of Metal3MachineTemplate" // +kubebuilder:resource:path=metal3machinetemplates,scope=Namespaced,categories=cluster-api,shortName=m3mt;m3machinetemplate;m3machinetemplates;metal3mt;metal3machinetemplate // +kubebuilder:storageversion diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_metal3clusters.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_metal3clusters.yaml index e820961cd2..c97db27a4e 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_metal3clusters.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_metal3clusters.yaml @@ -111,6 +111,10 @@ spec: subresources: status: {} - additionalPrinterColumns: + - description: Time duration since creation of Metal3Cluster + jsonPath: .metadata.creationTimestamp + name: Age + type: date - description: metal3Cluster is Ready jsonPath: .status.ready name: Ready diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_metal3dataclaims.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_metal3dataclaims.yaml index 6e972987e7..c984b47fd2 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_metal3dataclaims.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_metal3dataclaims.yaml @@ -132,7 +132,12 @@ spec: storage: false subresources: status: {} - - name: v1alpha5 + - additionalPrinterColumns: + - description: Time duration since creation of Metal3DataClaim + jsonPath: .metadata.creationTimestamp + name: Age + type: date + name: v1alpha5 schema: openAPIV3Schema: description: Metal3DataClaim is the Schema for the metal3datas API diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_metal3datas.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_metal3datas.yaml index d3c4713547..956f2486a2 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_metal3datas.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_metal3datas.yaml @@ -171,7 +171,12 @@ spec: storage: false subresources: status: {} - - name: v1alpha5 + - additionalPrinterColumns: + - description: Time duration since creation of Metal3Data + jsonPath: .metadata.creationTimestamp + name: Age + type: date + name: v1alpha5 schema: openAPIV3Schema: description: Metal3Data is the Schema for the metal3datas API diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_metal3datatemplates.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_metal3datatemplates.yaml index 321224d721..ffb09fdda5 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_metal3datatemplates.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_metal3datatemplates.yaml @@ -855,6 +855,10 @@ spec: jsonPath: .metadata.labels.cluster\.x-k8s\.io/cluster-name name: Cluster type: string + - description: Time duration since creation of Metal3DataTemplate + jsonPath: .metadata.creationTimestamp + name: Age + type: date name: v1alpha5 schema: openAPIV3Schema: diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_metal3machines.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_metal3machines.yaml index 59e92e56ac..2da91368a1 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_metal3machines.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_metal3machines.yaml @@ -371,6 +371,10 @@ spec: subresources: status: {} - additionalPrinterColumns: + - description: Time duration since creation of Metal3Machine + jsonPath: .metadata.creationTimestamp + name: Age + type: date - description: Provider ID jsonPath: .spec.providerID name: ProviderID diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_metal3machinetemplates.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_metal3machinetemplates.yaml index b241d661b0..9fe0805f88 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_metal3machinetemplates.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_metal3machinetemplates.yaml @@ -227,7 +227,12 @@ spec: type: object served: true storage: false - - name: v1alpha5 + - additionalPrinterColumns: + - description: Time duration since creation of Metal3MachineTemplate + jsonPath: .metadata.creationTimestamp + name: Age + type: date + name: v1alpha5 schema: openAPIV3Schema: description: Metal3MachineTemplate is the Schema for the metal3machinetemplates @@ -430,6 +435,7 @@ spec: type: object served: true storage: true + subresources: {} status: acceptedNames: kind: ""