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

Adds flag to inspect non-running pod #244

Closed

Conversation

ashishranjan738
Copy link
Contributor

@ashishranjan738 ashishranjan738 commented Jan 9, 2020

Signed-off-by: Ashish Ranjan ashishranjan738@gmail.com

The oc adm inspect ns/<namespace> skips the collection of logs from non-running pods. But in some scenarios the user may want to include this data (i.e: must-gather for OCS needs this). This commit adds a --non-running-pods flag to include the logs from non-running pod.

Fixes: #179

@openshift-ci-robot openshift-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jan 9, 2020
@ashishranjan738 ashishranjan738 force-pushed the non-running branch 2 times, most recently from 55f4b16 to 50a4da1 Compare January 9, 2020 04:44
@openshift-ci-robot openshift-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jan 9, 2020
@soltysh soltysh self-assigned this Jan 9, 2020
Signed-off-by: Ashish Ranjan <ashishranjan738@gmail.com>

The `oc adm inspect ns/<namespace>` skips the collection of logs from non-running pods. But in some scenarios the user may want to include this data (i.e: must-gather for OCS needs this). This commit adds a flag to include the logs from non-running pod.
@openshift-ci-robot openshift-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jan 9, 2020
@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: ashishranjan738
To complete the pull request process, please assign soltysh
You can assign the PR to them by writing /assign @soltysh in a comment when ready.

The full list of commands accepted by this bot can be found 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

@ashishranjan738
Copy link
Contributor Author

/test e2e-aws

1 similar comment
@ashishranjan738
Copy link
Contributor Author

/test e2e-aws

@ashishranjan738
Copy link
Contributor Author

@soltysh any suggestions on the flag name for this PR ?

@ashishranjan738
Copy link
Contributor Author

@soltysh any suggestions on the flag name for this PR ?

I m thinking of changing to --include-non-ready-resources

@ashishranjan738
Copy link
Contributor Author

/test e2e-aws

@@ -17,7 +17,7 @@ import (
)

func (o *InspectOptions) gatherPodData(destDir, namespace string, pod *corev1.Pod) error {
if pod.Status.Phase != corev1.PodRunning {
if pod.Status.Phase != corev1.PodRunning && !o.inspectNonRunningPod {
Copy link
Member

Choose a reason for hiding this comment

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

That's not sufficient, we scrape much more data, which rely on the pod running. You'd need a clear definition what you can scrape from running and what from other pods. The current condition changes are not sufficient.

@@ -100,7 +101,7 @@ func NewCmdInspect(streams genericclioptions.IOStreams, parentCommandPath string

cmd.Flags().StringVar(&o.destDir, "dest-dir", o.destDir, "Root directory used for storing all gathered cluster operator data. Defaults to $(PWD)/inspect.local.<rand>")
cmd.Flags().BoolVarP(&o.allNamespaces, "all-namespaces", "A", o.allNamespaces, "If present, list the requested object(s) across all namespaces. Namespace in current context is ignored even if specified with --namespace.")

cmd.Flags().BoolVarP(&o.inspectNonRunningPod, "non-running-pods", "", o.inspectNonRunningPod, "If present, doesn't skips the collection of non running pods")
Copy link
Member

Choose a reason for hiding this comment

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

Maybe just all-pods.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yup makes sense

@soltysh
Copy link
Member

soltysh commented Jan 20, 2020

@ashishranjan738 would #262 satisfy your needs? It's simpler.

@ashishranjan738
Copy link
Contributor Author

@ashishranjan738 would #262 satisfy your needs? It's simpler.

yeah but I have a follow-up comment on that PR

@soltysh
Copy link
Member

soltysh commented Jan 21, 2020

yeah but I have a follow-up comment on that PR

sgtm, let's move the discussion to the other PR.
/close

@openshift-ci-robot
Copy link

@soltysh: Closed this PR.

In response to this:

yeah but I have a follow-up comment on that PR

sgtm, let's move the discussion to the other PR.
/close

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.

@ashishranjan738 ashishranjan738 deleted the non-running branch March 6, 2020 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RFE: "oc adm inspect namespace" should collect logs of non-running pods.
3 participants