openshift-kni / debug-tools

debug and troubleshooting tools to check CNF workload configuration - unsupported
Apache License 2.0
0 stars 10 forks source link

Add new `pod-info` command. #64

Closed jlojosnegros closed 2 years ago

jlojosnegros commented 2 years ago

This command will allow us to gather some pod information filtered by node.

The pod information gathered is filtered with a go-template. Right now that template is hard-coded but it would be easy to use an incoming param to read it from a file name if needed in the future. Pod information is filtered because we want to avoid to show sensible information in the must-gather tool.

When, if ever, change the output go-template consider: 1.- this output is going to be parsed at must-gather-pao so any change should be carefully synced 2.- be sure no sensible information is in the final output (like environmental variables or command parameters that can contain passwords)

Target for this PR is to create a command to gather the same info as with openshift-kni/performance-addon-operators#906 but without using raw oc commands

jlojosnegros commented 2 years ago

/hold

jlojosnegros commented 2 years ago

/cc @fromanirh

ffromani commented 2 years ago

mixed versions in go.mod using this version set should work

diff --git a/go.mod b/go.mod
index 20ab0e5..3d3ffcc 100644
--- a/go.mod
+++ b/go.mod
@@ -11,6 +11,9 @@ require (
        github.com/safchain/ethtool v0.2.0
        github.com/spf13/cobra v1.2.1
        github.com/spf13/pflag v1.0.5
+       k8s.io/api v0.23.0
+       k8s.io/apimachinery v0.23.0
+       k8s.io/client-go v0.23.0
        k8s.io/klog/v2 v2.30.0
        k8s.io/kubelet v0.23.0
        k8s.io/kubernetes v0.23.0
@@ -23,6 +26,7 @@ require (
        github.com/blang/semver v3.5.1+incompatible // indirect
        github.com/cespare/xxhash/v2 v2.1.1 // indirect
        github.com/davecgh/go-spew v1.1.1 // indirect
+       github.com/evanphx/json-patch v4.12.0+incompatible // indirect
        github.com/fsnotify/fsnotify v1.4.9 // indirect
        github.com/ghodss/yaml v1.0.0 // indirect
        github.com/go-logr/logr v1.2.0 // indirect
@@ -32,6 +36,7 @@ require (
        github.com/google/gofuzz v1.1.0 // indirect
        github.com/google/uuid v1.1.2 // indirect
        github.com/googleapis/gnostic v0.5.5 // indirect
+       github.com/imdario/mergo v0.3.5 // indirect
        github.com/inconshreveable/mousetrap v1.0.0 // indirect
        github.com/jaypipes/pcidb v0.6.0 // indirect
        github.com/json-iterator/go v1.1.12 // indirect
@@ -62,10 +67,7 @@ require (
        gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
        gopkg.in/yaml.v2 v2.4.0 // indirect
        gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
-       k8s.io/api v0.23.0 // indirect
-       k8s.io/apimachinery v0.23.0 // indirect
        k8s.io/apiserver v0.23.0 // indirect
-       k8s.io/client-go v0.23.0 // indirect
        k8s.io/component-base v0.23.0 // indirect
        k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65 // indirect
        k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b // indirect
openshift-ci[bot] commented 2 years ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fromanirh, jlojosnegros

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: - ~~[OWNERS](https://github.com/openshift-kni/debug-tools/blob/main/OWNERS)~~ [fromanirh,jlojosnegros] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
jlojosnegros commented 2 years ago

/unhold

jlojosnegros commented 2 years ago

/cherry-pick release-4.10

openshift-cherrypick-robot commented 2 years ago

@jlojosnegros: new pull request created: #67

In response to [this](https://github.com/openshift-kni/debug-tools/pull/64#issuecomment-1163272536): >/cherry-pick release-4.10 Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.