New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Include Conditions in kubectl describe namespace
#106219
Include Conditions in kubectl describe namespace
#106219
Conversation
@dlipovetsky: This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The 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. |
f5936e3
to
55923f5
Compare
Failed for both tests, but appears unrelated to the PR. /test pull-kubernetes-e2e-kind |
/assign |
/cc |
if len(namespace.Status.Conditions) > 0 { | ||
w.Write(LEVEL_0, "Conditions:\n") | ||
w.Write(LEVEL_1, "Type\tStatus\tLastTransitionTime\tReason\tMessage\n") | ||
w.Write(LEVEL_1, "----\t------\t------------------\t------\t-------\n") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about a quite long message or reason?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, when leaving a review comment, explain what your concern is, and, if possible, give an example.
There are many functions in this package that use this same formatting. The writer interprets the tabs as separators, not as literal tabs. Here's what the output looks like with a long reasons and message:
Name: example
Labels: <none>
Annotations: <none>
Status: Terminating
Conditions:
Type Status LastTransitionTime Reason Message
---- ------ ------------------ ------ -------
NamespaceDeletionContentFailure True Wed, 15 Jan 2014 00:00:00 +0000 eexample reason example reason example reason example reason example reason example reason example reason example reason example reason example reason example reason example reason xample reason example reason example message example message example message example message example message example message example message example message example message example message example message example message example message
No resource quota.
No LimitRange resource.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for your advices @dlipovetsky , the code looks good to me.
If a namespace deletion is blocked, finding the reason why can require reading the Conditions on the namespace. Currently, `kubectl describe namespace` does not include Conditions. This change adds Conditions to the output. Example output: ``` Name: example Labels: <none> Annotations: <none> Status: Terminating Conditions: Type Status LastTransitionTime Reason Message ---- ------ ------------------ ------ ------- NamespaceDeletionContentFailure True Wed, 15 Jan 2014 00:00:00 +0000 example reason example message No resource quota. No LimitRange resource. ```
55923f5
to
eb6e8ce
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dlipovetsky, eddiezane The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Failure is unrelated. /test pull-kubernetes-unit |
What type of PR is this?
/kind feature
What this PR does / why we need it:
Currently,
kubectl describe namespace
does not include Conditions.This change adds Conditions to the output. Example output:
Which issue(s) this PR fixes:
Fixes #106218
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: