From 57dad45441d34f1e63c3739f19170452a65ed23e Mon Sep 17 00:00:00 2001 From: JoshVanL Date: Tue, 5 Nov 2019 18:26:48 +0000 Subject: [PATCH 1/2] Adds more informative output of kubectl get on [cluster]issuers Signed-off-by: JoshVanL --- pkg/apis/certmanager/v1alpha2/types_issuer.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/apis/certmanager/v1alpha2/types_issuer.go b/pkg/apis/certmanager/v1alpha2/types_issuer.go index 75e81eb4e..1a702f13e 100644 --- a/pkg/apis/certmanager/v1alpha2/types_issuer.go +++ b/pkg/apis/certmanager/v1alpha2/types_issuer.go @@ -28,6 +28,9 @@ import ( // +k8s:openapi-gen=true // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type==\"Ready\")].status",description="" +// +kubebuilder:printcolumn:name="Status",type="string",JSONPath=".status.conditions[?(@.type==\"Ready\")].message",description="" +// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC." // +kubebuilder:subresource:status // +kubebuilder:resource:path=clusterissuers,scope=Cluster type ClusterIssuer struct { @@ -52,6 +55,9 @@ type ClusterIssuerList struct { // +k8s:openapi-gen=true // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type==\"Ready\")].status",description="" +// +kubebuilder:printcolumn:name="Status",type="string",JSONPath=".status.conditions[?(@.type==\"Ready\")].message",description="" +// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC." // +kubebuilder:subresource:status // +kubebuilder:resource:path=issuers type Issuer struct { From 06ce5061bac9bdc528c3cecec4b8e971ffdd4664 Mon Sep 17 00:00:00 2001 From: JoshVanL Date: Mon, 11 Nov 2019 12:25:37 +0000 Subject: [PATCH 2/2] Set printer columns by changing crds in deploy Signed-off-by: JoshVanL --- .../cert-manager/crds/clusterissuers.yaml | 15 ++++++++++ deploy/charts/cert-manager/crds/issuers.yaml | 15 ++++++++++ deploy/manifests/00-crds.yaml | 30 +++++++++++++++++++ pkg/apis/certmanager/v1alpha2/types_issuer.go | 3 -- 4 files changed, 60 insertions(+), 3 deletions(-) diff --git a/deploy/charts/cert-manager/crds/clusterissuers.yaml b/deploy/charts/cert-manager/crds/clusterissuers.yaml index 093b37765..3a6cdf427 100644 --- a/deploy/charts/cert-manager/crds/clusterissuers.yaml +++ b/deploy/charts/cert-manager/crds/clusterissuers.yaml @@ -3,6 +3,21 @@ kind: CustomResourceDefinition metadata: name: clusterissuers.cert-manager.io spec: + additionalPrinterColumns: + - JSONPath: .status.conditions[?(@.type=="Ready")].status + name: Ready + type: string + - JSONPath: .status.conditions[?(@.type=="Ready")].message + name: Status + priority: 1 + type: string + - JSONPath: .metadata.creationTimestamp + description: CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. + name: Age + type: date group: cert-manager.io names: kind: ClusterIssuer diff --git a/deploy/charts/cert-manager/crds/issuers.yaml b/deploy/charts/cert-manager/crds/issuers.yaml index 91b9866d0..da5575659 100644 --- a/deploy/charts/cert-manager/crds/issuers.yaml +++ b/deploy/charts/cert-manager/crds/issuers.yaml @@ -3,6 +3,21 @@ kind: CustomResourceDefinition metadata: name: issuers.cert-manager.io spec: + additionalPrinterColumns: + - JSONPath: .status.conditions[?(@.type=="Ready")].status + name: Ready + type: string + - JSONPath: .status.conditions[?(@.type=="Ready")].message + name: Status + priority: 1 + type: string + - JSONPath: .metadata.creationTimestamp + description: CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. + name: Age + type: date group: cert-manager.io names: kind: Issuer diff --git a/deploy/manifests/00-crds.yaml b/deploy/manifests/00-crds.yaml index 98c5e70d3..1fbc0223e 100644 --- a/deploy/manifests/00-crds.yaml +++ b/deploy/manifests/00-crds.yaml @@ -1788,6 +1788,21 @@ kind: CustomResourceDefinition metadata: name: clusterissuers.cert-manager.io spec: + additionalPrinterColumns: + - JSONPath: .status.conditions[?(@.type=="Ready")].status + name: Ready + type: string + - JSONPath: .status.conditions[?(@.type=="Ready")].message + name: Status + priority: 1 + type: string + - JSONPath: .metadata.creationTimestamp + description: CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. + name: Age + type: date group: cert-manager.io names: kind: ClusterIssuer @@ -3444,6 +3459,21 @@ kind: CustomResourceDefinition metadata: name: issuers.cert-manager.io spec: + additionalPrinterColumns: + - JSONPath: .status.conditions[?(@.type=="Ready")].status + name: Ready + type: string + - JSONPath: .status.conditions[?(@.type=="Ready")].message + name: Status + priority: 1 + type: string + - JSONPath: .metadata.creationTimestamp + description: CreationTimestamp is a timestamp representing the server time when + this object was created. It is not guaranteed to be set in happens-before order + across separate operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. + name: Age + type: date group: cert-manager.io names: kind: Issuer diff --git a/pkg/apis/certmanager/v1alpha2/types_issuer.go b/pkg/apis/certmanager/v1alpha2/types_issuer.go index 1a702f13e..b881485f6 100644 --- a/pkg/apis/certmanager/v1alpha2/types_issuer.go +++ b/pkg/apis/certmanager/v1alpha2/types_issuer.go @@ -28,9 +28,6 @@ import ( // +k8s:openapi-gen=true // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type==\"Ready\")].status",description="" -// +kubebuilder:printcolumn:name="Status",type="string",JSONPath=".status.conditions[?(@.type==\"Ready\")].message",description="" -// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC." // +kubebuilder:subresource:status // +kubebuilder:resource:path=clusterissuers,scope=Cluster type ClusterIssuer struct {