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

Bug 2062355: Collect NMState resources when operator is installed #292

Merged
merged 1 commit into from Mar 22, 2022

Conversation

creydr
Copy link
Member

@creydr creydr commented Mar 16, 2022

Currently we are missing the NMState resources in the must-gathers. This is especially a problem as the kubernetes-nmstate-operator became GA in 4.10.
This PR addresses it and adds the NMState resources (namespace resources & CRs) to the must-gathers when the operator is installed.

Hints for reviewers:
I was following a similar approach to how MetalLB is collecting its resources (./collection-scripts/gather_metallb_logs). If there is an easier way (e.g. by adding a certain annotation), please let me know.

How to verify:

  1. Deploy a cluster and install the NMState operator (e.g. via the marketplace)
  2. Add the NMState CR:
    cat <<EOF | oc apply -f -
    apiVersion: nmstate.io/v1
    kind: NMState
    metadata:
      name: nmstate
    EOF
    
  3. Wait for the handler being deployed on all nodes (e.g. oc -n openshift-nmstate get po -w)
  4. Add a simple nodenetworkconfigurationpolicy. e.g.:
    cat <<EOF | oc apply -f -
    apiVersion: nmstate.io/v1
    kind: NodeNetworkConfigurationPolicy
    metadata:
      name: br1-eth0
    spec:
      desiredState:
        interfaces:
        - name: br1
          type: linux-bridge
          state: up
          ipv4:
            dhcp: true
            enabled: true
          bridge:
            port:
            - name: eth0
    EOF
    
  5. Collect the must-gathers and check for the nmstate resouces (e.g. omg get nnce)

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 16, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 16, 2022

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@creydr
Copy link
Member Author

creydr commented Mar 16, 2022

/retitle Bug 2062355: Collect NMState resources when operator is installed

@openshift-ci openshift-ci bot changed the title Collect NMState resources when operator is installed Bug 2062355: Collect NMState resources when operator is installed Mar 16, 2022
@openshift-ci openshift-ci bot added bugzilla/severity-medium Referenced Bugzilla bug's severity is medium for the branch this PR is targeting. bugzilla/invalid-bug Indicates that a referenced Bugzilla bug is invalid for the branch this PR is targeting. labels Mar 16, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 16, 2022

@creydr: This pull request references Bugzilla bug 2062355, which is invalid:

  • expected the bug to target the "4.11.0" release, but it targets "---" instead

Comment /bugzilla refresh to re-evaluate validity if changes to the Bugzilla bug are made, or edit the title of this pull request to link to a different bug.

In response to this:

Bug 2062355: Collect NMState resources when operator is installed

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.

@creydr
Copy link
Member Author

creydr commented Mar 16, 2022

/test all

@creydr
Copy link
Member Author

creydr commented Mar 16, 2022

/bugzilla refresh

@openshift-ci openshift-ci bot added bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. and removed bugzilla/invalid-bug Indicates that a referenced Bugzilla bug is invalid for the branch this PR is targeting. labels Mar 16, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 16, 2022

@creydr: This pull request references Bugzilla bug 2062355, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.11.0) matches configured target release for branch (4.11.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

Requesting review from QA contact:
/cc @amalykhi

In response to this:

/bugzilla refresh

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.

@openshift-ci openshift-ci bot requested a review from amalykhi March 16, 2022 10:42
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 16, 2022

@creydr: This pull request references Bugzilla bug 2062355, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.11.0) matches configured target release for branch (4.11.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

Requesting review from QA contact:
/cc @amalykhi

In response to this:

Bug 2062355: Collect NMState resources when operator is installed

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.

@creydr creydr marked this pull request as ready for review March 16, 2022 11:49
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 16, 2022
@openshift-ci openshift-ci bot requested a review from davemulford March 16, 2022 11:49
@creydr
Copy link
Member Author

creydr commented Mar 16, 2022

@cybertron @qinqon @rhrazdil: fyi

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 16, 2022

@creydr: This pull request references Bugzilla bug 2062355, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.11.0) matches configured target release for branch (4.11.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

Requesting review from QA contact:
/cc @amalykhi

In response to this:

Bug 2062355: Collect NMState resources when operator is installed

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.

@qinqon
Copy link

qinqon commented Mar 16, 2022

@creydr we have a must-gather bits to retrieve knmstate stuff at openshift virtualization, maybe you can take inspiration from there.

UPDATE: This is the place https://github.com/kubevirt/must-gather/blob/main/collection-scripts/gather#L16

collection-scripts/gather_nmstate_logs Outdated Show resolved Hide resolved
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 16, 2022

@creydr: This pull request references Bugzilla bug 2062355, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.11.0) matches configured target release for branch (4.11.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

Requesting review from QA contact:
/cc @amalykhi

In response to this:

Bug 2062355: Collect NMState resources when operator is installed

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.

collection-scripts/gather Outdated Show resolved Hide resolved
@@ -0,0 +1,28 @@
#!/bin/bash
Copy link

@qinqon qinqon Mar 16, 2022

Choose a reason for hiding this comment

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

Do we fail must-gather if one of the script fails ? for that we need to do set -e

Copy link
Member Author

Choose a reason for hiding this comment

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

That's probably something @RickJWagner or @sferich888 can answer better

Copy link
Contributor

Choose a reason for hiding this comment

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

Given that must-gather might run in clusters that are having problems, we should probably tend to be more forgiving of errors. (And let things run as bullet-proof as possible, even if it means we give extra leniency to components that don't complete their jobs error-free.) We'd prefer to get as much information as possible, even if some pieces of information are unavailable.

Signed-off-by: Christoph Stäbler <cstabler@redhat.com>
@creydr
Copy link
Member Author

creydr commented Mar 16, 2022

/assign @RickJWagner

Copy link
Contributor

@RickJWagner RickJWagner left a comment

Choose a reason for hiding this comment

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

This looks good to me.

One point to consider: There's a lot of similarity between gather_nmstate and scripts like gather_metallb_logs. Maybe consider factoring out the common stuff into a script that could be sourced by other scripts. (DRY).

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 16, 2022
@RickJWagner RickJWagner removed their assignment Mar 17, 2022
@cybertron
Copy link
Member

Tried it locally, looks like it captured everything we need.
/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Mar 17, 2022
@amalykhi
Copy link

/lgtm

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 20, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: amalykhi, creydr, cybertron, RickJWagner

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

@creydr
Copy link
Member Author

creydr commented Mar 22, 2022

/test all

@creydr
Copy link
Member Author

creydr commented Mar 22, 2022

/retest-required

1 similar comment
@creydr
Copy link
Member Author

creydr commented Mar 22, 2022

/retest-required

@creydr
Copy link
Member Author

creydr commented Mar 22, 2022

/test e2e-aws

2 similar comments
@creydr
Copy link
Member Author

creydr commented Mar 22, 2022

/test e2e-aws

@creydr
Copy link
Member Author

creydr commented Mar 22, 2022

/test e2e-aws

@creydr
Copy link
Member Author

creydr commented Mar 22, 2022

/retest-required

@creydr
Copy link
Member Author

creydr commented Mar 22, 2022

/test e2e-aws

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

2 similar comments
@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 22, 2022

@creydr: all tests passed!

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

@openshift-merge-robot openshift-merge-robot merged commit b22ad2b into openshift:master Mar 22, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 22, 2022

@creydr: All pull requests linked via external trackers have merged:

Bugzilla bug 2062355 has been moved to the MODIFIED state.

In response to this:

Bug 2062355: Collect NMState resources when operator is installed

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.

@creydr creydr mentioned this pull request Mar 23, 2022
@creydr
Copy link
Member Author

creydr commented Mar 29, 2022

/cherry-pick release-4.10

@openshift-cherrypick-robot

@creydr: new pull request created: #294

In response to this:

/cherry-pick release-4.10

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.

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. bugzilla/severity-medium Referenced Bugzilla bug's severity is medium for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants