Skip to content

Support multiple reasons per condition for CustomPluginMonitor #665

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

Closed
wants to merge 2 commits into from

Conversation

jason1028kr
Copy link
Contributor

Issue: #664

Original issue that describes current behavior: #566

  • plugin uses intervalEndChan to signal interval end (all plugins ran for the interval).

  • custom_plugin_monitor.go's monitorLoop() function now gathers result until it receives interval end signal. Only then, it calls new generateStatus(results []cpmtypes.Result) to create one event for each condition.

  • unit test added

  • local testing output on a test cluster below

New behaviors:

Node describe output:

  Normal  TestIsIntentionallyFailing  6s (x57 over 56m)     test-custom-plugin-monitor  Node condition TestConditionHasProblem is now: True, reason: TestIsIntentionallyFailing

NPD pod logs:

I0407 00:18:53.174047       1 custom_plugin_monitor.go:361] Initialize condition generated: [{Type:TestConditionHasProblem Status:False Transition:2022-04-07 00:18:53.174038607 +0000 UTC m=+4.099922893 Reason:TestIsOK Message:test condition is OK}]
I0407 00:19:53.173518       1 custom_plugin_monitor.go:340] New status generated: &{Source:test-custom-plugin-monitor Events:[{Severity:info Timestamp:2022-04-07 00:19:53.075037997 +0000 UTC m=+64.000922383 Reason:TestIsIntentionallyFailing Message:Node condition TestConditionHasProblem is now: True, reason: TestIsIntentionallyFailing}] Conditions:[{Type:TestConditionHasProblem Status:True Transition:2022-04-07 00:19:53.075037997 +0000 UTC m=+64.000922383 Reason:TestIsIntentionallyFailing Message:}]}
I0407 00:20:52.977094       1 custom_plugin_monitor.go:340] New status generated: &{Source:test-custom-plugin-monitor Events:[{Severity:info Timestamp:2022-04-07 00:20:52.977058649 +0000 UTC m=+123.902942935 Reason:TestIsIntentionallyFailing Message:Node condition TestConditionHasProblem is now: True, reason: TestIsIntentionallyFailing}] Conditions:[{Type:TestConditionHasProblem Status:True Transition:2022-04-07 00:19:53.075037997 +0000 UTC m=+64.000922383 Reason:TestIsIntentionallyFailing Message:}]}
I0407 00:21:53.075186       1 custom_plugin_monitor.go:340] New status generated: &{Source:test-custom-plugin-monitor Events:[{Severity:info Timestamp:2022-04-07 00:21:53.075120494 +0000 UTC m=+184.001004780 Reason:TestIsIntentionallyFailing Message:Node condition TestConditionHasProblem is now: True, reason: TestIsIntentionallyFailing}] Conditions:[{Type:TestConditionHasProblem Status:True Transition:2022-04-07 00:19:53.075037997 +0000 UTC m=+64.000922383 Reason:TestIsIntentionallyFailing Message:}]}
I0407 00:22:53.074590       1 custom_plugin_monitor.go:340] New status generated: &{Source:test-custom-plugin-monitor Events:[{Severity:info Timestamp:2022-04-07 00:22:53.074550383 +0000 UTC m=+244.000434769 Reason:TestIsIntentionallyFailing Message:Node condition TestConditionHasProblem is now: True, reason: TestIsIntentionallyFailing}] Conditions:[{Type:TestConditionHasProblem Status:True Transition:2022-04-07 00:19:53.075037997 +0000 UTC m=+64.000922383 Reason:TestIsIntentionallyFailing Message:}]}

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Apr 7, 2022

CLA Signed

The committers listed above are authorized under a signed CLA.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Apr 7, 2022
@k8s-ci-robot
Copy link
Contributor

Welcome @jason1028kr!

It looks like this is your first PR to kubernetes/node-problem-detector 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/node-problem-detector has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot
Copy link
Contributor

Hi @jason1028kr. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Apr 7, 2022
@jason1028kr jason1028kr force-pushed the jjung/test-cpm-pr branch 2 times, most recently from 59658c0 to 5eff954 Compare April 7, 2022 18:07
@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 Apr 7, 2022
@vteratipally
Copy link
Collaborator

thank you for the PR. Could you please squash all commits into one.

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Apr 11, 2022

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: jason1028kr / name: Jason Jung (3702270)

@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 Apr 11, 2022
@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 Apr 11, 2022
@jason1028kr
Copy link
Contributor Author

thank you for the PR. Could you please squash all commits into one.

Thank you! I've squashed them to one.

@k8s-ci-robot
Copy link
Contributor

@jason1028kr: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/ok-to-test

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.

@jason1028kr
Copy link
Contributor Author

/assign @dchen1107

@vteratipally
Copy link
Collaborator

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Apr 27, 2022
@jason1028kr
Copy link
Contributor Author

@vteratipally Does this look good to go ahead?

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 15, 2022
@juan-lee
Copy link

@vteratipally could you have another look please?

@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 22, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: jason1028kr
To complete the pull request process, please ask for approval from dchen1107 after the PR has been reviewed.

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

@juan-lee
Copy link

@dchen1107 would you be able to help @jason1028kr with a review on his PR?

@vteratipally
Copy link
Collaborator

Overall pr looks good. I will have to do a manual testing

@vteratipally
Copy link
Collaborator

Random-Liu could you please take a look at the pr

@jason1028kr
Copy link
Contributor Author

Hello @Random-Liu! Would you mind taking a look at this pr?

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 16, 2022
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Nov 15, 2022
@vteratipally
Copy link
Collaborator

/remove-lifecycle rotten

@k8s-ci-robot k8s-ci-robot removed the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label Nov 15, 2022
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Mark this PR as fresh with /remove-lifecycle stale
  • Close this PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Feb 13, 2023
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Mark this PR as fresh with /remove-lifecycle rotten
  • Close this PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Mar 15, 2023
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Reopen this PR with /reopen
  • Mark this PR as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close

@k8s-ci-robot
Copy link
Contributor

@k8s-triage-robot: Closed this PR.

In response to this:

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Reopen this PR with /reopen
  • Mark this PR as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants