openshift / must-gather

A client tool for gathering information about an operator managed component.
Apache License 2.0
104 stars 189 forks source link

SDN-4597: Add cluster scoped ANP resource to collection #411

Closed tssurya closed 7 months ago

tssurya commented 7 months ago

This PR adds support to must-gather for collecting crds of globally scoped resource: ANP. See https://issues.redhat.com/browse/SDN-4157 for downstream details See https://network-policy-api.sigs.k8s.io/reference/spec/ for API reference.

Tested on 4.16 cluster:

[must-gather-pc2zx] OUT ./cluster-scoped-resources/policy.networking.k8s.io/adminnetworkpolicies/node-as-egress-peers.yaml                                                   
[must-gather-pc2zx] OUT ./cluster-scoped-resources/policy.networking.k8s.io/adminnetworkpolicies/trial.yaml                                                                  
[must-gather-pc2zx] OUT ./cluster-scoped-resources/policy.networking.k8s.io/adminnetworkpolicies/trial3.yaml                                                                 
[must-gather-pc2zx] OUT ./cluster-scoped-resources/policy.networking.k8s.io/baselineadminnetworkpolicies/default.yaml

Collection seems to work as expected:

surya@hidden-temple:~/go/src/github.com/openshift/must-gather/must-gather.local.8142207633888895565/quay-io-itssurya-dev-images-sha256-52b9a1cd2a5cab9e57cccfc7cb4975e595bf0ef36a78852f26dc08506fcbd23d/cluster-scoped-resources/policy.networking.k8s.io$ ls
adminnetworkpolicies  baselineadminnetworkpolicies
surya@hidden-temple:~/go/src/github.com/openshift/must-gather/must-gather.local.8142207633888895565/quay-io-itssurya-dev-images-sha256-52b9a1cd2a5cab9e57cccfc7cb4975e595bf0ef36a78852f26dc08506fcbd23d/cluster-scoped-resources/policy.networking.k8s.io$ 
surya@hidden-temple:~/go/src/github.com/openshift/must-gather/must-gather.local.8142207633888895565/quay-io-itssurya-dev-images-sha256-52b9a1cd2a5cab9e57cccfc7cb4975e595bf0ef36a78852f26dc08506fcbd23d/cluster-scoped-resources/policy.networking.k8s.io$ cd adminnetworkpolicies/
surya@hidden-temple:~/go/src/github.com/openshift/must-gather/must-gather.local.8142207633888895565/quay-io-itssurya-dev-images-sha256-52b9a1cd2a5cab9e57cccfc7cb4975e595bf0ef36a78852f26dc08506fcbd23d/cluster-scoped-resources/policy.networking.k8s.io/adminnetworkpolicies$ ls
node-as-egress-peers.yaml  trial3.yaml  trial.yaml
surya@hidden-temple:~/go/src/github.com/openshift/must-gather/must-gather.local.8142207633888895565/quay-io-itssurya-dev-images-sha256-52b9a1cd2a5cab9e57cccfc7cb4975e595bf0ef36a78852f26dc08506fcbd23d/cluster-scoped-resources/policy.networking.k8s.io/adminnetworkpolicies$ cd ..
surya@hidden-temple:~/go/src/github.com/openshift/must-gather/must-gather.local.8142207633888895565/quay-io-itssurya-dev-images-sha256-52b9a1cd2a5cab9e57cccfc7cb4975e595bf0ef36a78852f26dc08506fcbd23d/cluster-scoped-resources/policy.networking.k8s.io$ cd baselineadminnetworkpolicies/
surya@hidden-temple:~/go/src/github.com/openshift/must-gather/must-gather.local.8142207633888895565/quay-io-itssurya-dev-images-sha256-52b9a1cd2a5cab9e57cccfc7cb4975e595bf0ef36a78852f26dc08506fcbd23d/cluster-scoped-resources/policy.networking.k8s.io/baselineadminnetworkpolicies$ ls
default.yaml
openshift-ci-robot commented 7 months ago

@tssurya: This pull request references SDN-4597 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.16.0" version, but no target version was set.

In response to [this](https://github.com/openshift/must-gather/pull/411): >This PR adds support to must-gather for collecting crds of globally scoped resource: ANP. >See https://issues.redhat.com/browse/SDN-4157 for downstream details >See https://network-policy-api.sigs.k8s.io/reference/spec/ for API reference. Instructions for interacting with me using PR comments are available [here](https://prow.ci.openshift.org/command-help?repo=openshift%2Fmust-gather). If you have questions or suggestions related to my behavior, please file an issue against the [openshift-eng/jira-lifecycle-plugin](https://github.com/openshift-eng/jira-lifecycle-plugin/issues/new) repository.
openshift-ci[bot] commented 7 months ago

@tssurya: all tests passed!

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
openshift-ci-robot commented 7 months ago

@tssurya: This pull request references SDN-4597 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.16.0" version, but no target version was set.

In response to [this](https://github.com/openshift/must-gather/pull/411): >This PR adds support to must-gather for collecting crds of globally scoped resource: ANP. >See https://issues.redhat.com/browse/SDN-4157 for downstream details >See https://network-policy-api.sigs.k8s.io/reference/spec/ for API reference. > >``` >[must-gather-pc2zx] OUT ./cluster-scoped-resources/policy.networking.k8s.io/adminnetworkpolicies/node-as-egress-peers.yaml >[must-gather-pc2zx] OUT ./cluster-scoped-resources/policy.networking.k8s.io/adminnetworkpolicies/trial.yaml >[must-gather-pc2zx] OUT ./cluster-scoped-resources/policy.networking.k8s.io/adminnetworkpolicies/trial3.yaml >[must-gather-pc2zx] OUT ./cluster-scoped-resources/policy.networking.k8s.io/baselineadminnetworkpolicies/default.yaml >``` Instructions for interacting with me using PR comments are available [here](https://prow.ci.openshift.org/command-help?repo=openshift%2Fmust-gather). If you have questions or suggestions related to my behavior, please file an issue against the [openshift-eng/jira-lifecycle-plugin](https://github.com/openshift-eng/jira-lifecycle-plugin/issues/new) repository.
tssurya commented 7 months ago

/assign @pperiyasamy

pperiyasamy commented 7 months ago

/lgtm

openshift-ci-robot commented 7 months ago

@tssurya: This pull request references SDN-4597 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.16.0" version, but no target version was set.

In response to [this](https://github.com/openshift/must-gather/pull/411): >This PR adds support to must-gather for collecting crds of globally scoped resource: ANP. >See https://issues.redhat.com/browse/SDN-4157 for downstream details >See https://network-policy-api.sigs.k8s.io/reference/spec/ for API reference. > >Tested on 4.16 cluster: >``` >[must-gather-pc2zx] OUT ./cluster-scoped-resources/policy.networking.k8s.io/adminnetworkpolicies/node-as-egress-peers.yaml >[must-gather-pc2zx] OUT ./cluster-scoped-resources/policy.networking.k8s.io/adminnetworkpolicies/trial.yaml >[must-gather-pc2zx] OUT ./cluster-scoped-resources/policy.networking.k8s.io/adminnetworkpolicies/trial3.yaml >[must-gather-pc2zx] OUT ./cluster-scoped-resources/policy.networking.k8s.io/baselineadminnetworkpolicies/default.yaml >``` > >Collection seems to work as expected: >``` >surya@hidden-temple:~/go/src/github.com/openshift/must-gather/must-gather.local.8142207633888895565/quay-io-itssurya-dev-images-sha256-52b9a1cd2a5cab9e57cccfc7cb4975e595bf0ef36a78852f26dc08506fcbd23d/cluster-scoped-resources/policy.networking.k8s.io$ ls >adminnetworkpolicies baselineadminnetworkpolicies >surya@hidden-temple:~/go/src/github.com/openshift/must-gather/must-gather.local.8142207633888895565/quay-io-itssurya-dev-images-sha256-52b9a1cd2a5cab9e57cccfc7cb4975e595bf0ef36a78852f26dc08506fcbd23d/cluster-scoped-resources/policy.networking.k8s.io$ >surya@hidden-temple:~/go/src/github.com/openshift/must-gather/must-gather.local.8142207633888895565/quay-io-itssurya-dev-images-sha256-52b9a1cd2a5cab9e57cccfc7cb4975e595bf0ef36a78852f26dc08506fcbd23d/cluster-scoped-resources/policy.networking.k8s.io$ cd adminnetworkpolicies/ >surya@hidden-temple:~/go/src/github.com/openshift/must-gather/must-gather.local.8142207633888895565/quay-io-itssurya-dev-images-sha256-52b9a1cd2a5cab9e57cccfc7cb4975e595bf0ef36a78852f26dc08506fcbd23d/cluster-scoped-resources/policy.networking.k8s.io/adminnetworkpolicies$ ls >node-as-egress-peers.yaml trial3.yaml trial.yaml >surya@hidden-temple:~/go/src/github.com/openshift/must-gather/must-gather.local.8142207633888895565/quay-io-itssurya-dev-images-sha256-52b9a1cd2a5cab9e57cccfc7cb4975e595bf0ef36a78852f26dc08506fcbd23d/cluster-scoped-resources/policy.networking.k8s.io/adminnetworkpolicies$ cd .. >surya@hidden-temple:~/go/src/github.com/openshift/must-gather/must-gather.local.8142207633888895565/quay-io-itssurya-dev-images-sha256-52b9a1cd2a5cab9e57cccfc7cb4975e595bf0ef36a78852f26dc08506fcbd23d/cluster-scoped-resources/policy.networking.k8s.io$ cd baselineadminnetworkpolicies/ >surya@hidden-temple:~/go/src/github.com/openshift/must-gather/must-gather.local.8142207633888895565/quay-io-itssurya-dev-images-sha256-52b9a1cd2a5cab9e57cccfc7cb4975e595bf0ef36a78852f26dc08506fcbd23d/cluster-scoped-resources/policy.networking.k8s.io/baselineadminnetworkpolicies$ ls >default.yaml >``` Instructions for interacting with me using PR comments are available [here](https://prow.ci.openshift.org/command-help?repo=openshift%2Fmust-gather). If you have questions or suggestions related to my behavior, please file an issue against the [openshift-eng/jira-lifecycle-plugin](https://github.com/openshift-eng/jira-lifecycle-plugin/issues/new) repository.
tssurya commented 7 months ago

/assign @RickJWagner for approve

sferich888 commented 7 months ago

/lgtm

openshift-ci[bot] commented 7 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: pperiyasamy, sferich888, tssurya

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: - ~~[collection-scripts/OWNERS](https://github.com/openshift/must-gather/blob/master/collection-scripts/OWNERS)~~ [sferich888] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
openshift-bot commented 7 months ago

[ART PR BUILD NOTIFIER]

This PR has been included in build ose-must-gather-container-v4.16.0-202404041616.p0.g36322ee.assembly.stream.el8 for distgit ose-must-gather. All builds following this will include this PR.