Skip to content
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

Improving kubectl get output #123440

Merged
merged 3 commits into from
May 30, 2024

Conversation

Ritikaa96
Copy link
Contributor

@Ritikaa96 Ritikaa96 commented Feb 22, 2024

Signed-off-by: Ritikaa96 <ritika@india.nec.com

What this PR does / why we need it:

Adding namespace flag & examples
kubectl get --help states the following even though we can use --namespace to get details for other namespace resources.

Display one or many resources.

 Prints a table of the most important information about the specified resources.
You can filter the list using a label selector and the --selector flag. If the
desired resource type is namespaced you will only see results in your current
namespace unless you pass --all-namespaces.
...

The description should mention --namespace as this can show objects/resources from different namespace as well

Which issue(s) this PR fixes:

Fixes #kubernetes/kubectl#1555

Special notes for your reviewer:

Does this PR introduce a user-facing change?

NONE

Does this PR introduce a user-facing change?

NONE

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

NONE

@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-kind Indicates a PR lacks a `kind/foo` label and requires one. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. area/kubectl sig/cli Categorizes an issue or PR as relevant to SIG CLI. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Feb 22, 2024
@Ritikaa96
Copy link
Contributor Author

/sig cli
/kind bug

@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. and removed do-not-merge/needs-kind Indicates a PR lacks a `kind/foo` label and requires one. labels Feb 22, 2024
@@ -92,7 +92,7 @@ var (
Prints a table of the most important information about the specified resources.
You can filter the list using a label selector and the --selector flag. If the
desired resource type is namespaced you will only see results in your current
namespace unless you pass --all-namespaces.
namespace unless you pass --all-namespaces or --namespace(for specific namespace)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about?

Suggested change
namespace unless you pass --all-namespaces or --namespace(for specific namespace)
namespace by passing --namespace(for specific namespace) unless you pass --all-namespaces.

Copy link
Contributor Author

@Ritikaa96 Ritikaa96 Feb 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The whole sentence doesnt make sense then.
how about

If the desired resource type is namespaced you will only see results in your current namespace unless you pass  --namespace  or --all-namespaces.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or better..

If the desired resource type is namespaced you will only see results in other namespaces by passing --namespace(for specific namespace) or --all-namespaces.

kubectl get deployments.apps --namespace backend

# List all pods existing in all namespaces
kubectl get pods --all-namspaces`))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
kubectl get pods --all-namspaces`))
kubectl get pods --all-namespaces`))

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh!! how did i miss that.

kubectl get pod web-pod-13je7 --subresource status`))
kubectl get pod web-pod-13je7 --subresource status

# List all deployments in namespace - backend
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# List all deployments in namespace - backend
# List all deployments in namespace 'backend'

@ardaguclu
Copy link
Member

/kind cleanup
/release-note-none

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Feb 22, 2024
@Ritikaa96
Copy link
Contributor Author

Made some changes PTAL @ardaguclu

@@ -91,8 +91,8 @@ var (

Prints a table of the most important information about the specified resources.
You can filter the list using a label selector and the --selector flag. If the
desired resource type is namespaced you will only see results in your current
namespace unless you pass --all-namespaces.
desired resource type is namespaced you will only see results in other namespaces
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or current namespace if user doesn't specify none of them?

@k8s-ci-robot k8s-ci-robot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. and removed cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Mar 1, 2024
@Ritikaa96
Copy link
Contributor Author

/easycla

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Mar 14, 2024
@Ritikaa96
Copy link
Contributor Author

Hi , is there anything to add in this PR as the PR is awaiting reviews from long.

@ardaguclu
Copy link
Member

Hi , is there anything to add in this PR as the PR is awaiting reviews from long.

This https://github.com/kubernetes/kubernetes/pull/123440/files#r1502075458 comment hasn't been resolved yet.

 Adding namespace flag & examples
Signed-off-by: Ritikaa96 <ritika@india.nec.com>
Signed-off-by: Ritikaa96 <ritika@india.nec.com>
Signed-off-by: Ritikaa96 <ritika@india.nec.com>
@Ritikaa96
Copy link
Contributor Author

Hi , is there anything to add in this PR as the PR is awaiting reviews from long.

This https://github.com/kubernetes/kubernetes/pull/123440/files#r1502075458 comment hasn't been resolved yet.

Hi @ardaguclu I have made some changes. PTAL. Does it look good or i should make another change?

@ardaguclu
Copy link
Member

Thank you
/lgtm
/approve
/triage accepted
/priority backlog

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. priority/backlog Higher priority than priority/awaiting-more-evidence. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels May 30, 2024
@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. and removed needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels May 30, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 207a2efea30bed8048287727d7814ce7c1a3300c

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ardaguclu, Ritikaa96

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 30, 2024
@ardaguclu
Copy link
Member

this is only doc change;
/retest

@ardaguclu
Copy link
Member

/retest

@k8s-triage-robot
Copy link

The Kubernetes project has merge-blocking tests that are currently too flaky to consistently pass.

This bot retests PRs for certain kubernetes repos according to the following rules:

  • The PR does have any do-not-merge/* labels
  • The PR does not have the needs-ok-to-test label
  • The PR is mergeable (does not have a needs-rebase label)
  • The PR is approved (has cncf-cla: yes, lgtm, approved labels)
  • The PR is failing tests required for merge

You can:

/retest

@Ritikaa96
Copy link
Contributor Author

Seems like all the test have passed . Waiting for @dims review .
Thanks a lot @ardaguclu !!

@k8s-ci-robot k8s-ci-robot merged commit 36f1d73 into kubernetes:master May 30, 2024
14 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.31 milestone May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/kubectl cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/backlog Higher priority than priority/awaiting-more-evidence. release-note-none Denotes a PR that doesn't merit a release note. sig/cli Categorizes an issue or PR as relevant to SIG CLI. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

4 participants