kubectl icon indicating copy to clipboard operation
kubectl copied to clipboard

Support human readable timestamps in `custom-columns` printer

Open ahmetb opened this issue 1 year ago • 3 comments

What would you like to be added:

Currently, --output=custom-columns=AGE:.metadata.creationTimestamp prints metav1.Time fields in ISO 8601 format (seen below), instead of the default "human readable" date strings like 3m or 16h that the default table printer uses.

kubectl get pods --output=custom-columns=NAME:.metadata.name,AGE:.metadata.creationTimestamp
NAME      AGE
foo-bar   2023-11-03T22:23:49Z

Why is this needed:

  • It would be better for users of kubectl plugins in general. I think some users would still prefer the current behavior.
  • Many kubectl plugins that are printing resourcecan importcli-runtimerepository and provide a default output format withcustom-columns` that uses creationTimestamp.

I'm not entirely sure if this is a valid ask, so please evaluate.

/sig cli

ahmetb avatar Nov 04 '23 18:11 ahmetb

This issue is currently awaiting triage.

SIG CLI takes a lead on issue triage for this repo, but any Kubernetes member can accept issues by applying the triage/accepted label.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

k8s-ci-robot avatar Nov 04 '23 18:11 k8s-ci-robot

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Feb 02 '24 19:02 k8s-triage-robot

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle rotten
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

k8s-triage-robot avatar Mar 03 '24 19:03 k8s-triage-robot