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

refactor: Returning error on calling GetContainerEvents() while enable_pod_events of runtime is disabled #7257

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MdSahil-oss
Copy link
Contributor

@MdSahil-oss MdSahil-oss commented Aug 29, 2023

What type of PR is this?

/kind bug

What this PR does / why we need it:

This PR adds an error message to return on calling GetContainerEvents() while enable_pod_events of runtime is disabled.

Which issue(s) this PR fixes:

#7164

Special notes for your reviewer:

Does this PR introduce a user-facing change?

the GetContainerEvents endpoint now errors when the `enable_pod_events` config field is false 

@MdSahil-oss MdSahil-oss requested a review from mrunalp as a code owner August 29, 2023 09:00
@openshift-ci openshift-ci bot added the kind/feature Categorizes issue or PR as related to a new feature. label Aug 29, 2023
@openshift-ci openshift-ci bot requested review from hasan4791 and QiWang19 August 29, 2023 09:00
@openshift-ci openshift-ci bot added dco-signoff: yes Indicates the PR's author has DCO signed all their commits. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Aug 29, 2023
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 29, 2023

Hi @MdSahil-oss. Thanks for your PR.

I'm waiting for a cri-o 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.

@codecov
Copy link

codecov bot commented Aug 29, 2023

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 49.23%. Comparing base (8ea1256) to head (59f5f15).
Report is 1567 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7257   +/-   ##
=======================================
  Coverage   49.23%   49.23%           
=======================================
  Files         136      136           
  Lines       15575    15575           
=======================================
+ Hits         7668     7669    +1     
+ Misses       7000     6999    -1     
  Partials      907      907           

@MdSahil-oss MdSahil-oss force-pushed the get-container-events branch 2 times, most recently from 301af0c to 66d53a9 Compare August 29, 2023 09:40
@haircommander
Copy link
Member

I should have thought of this! So yes, you do need to enable the config field to get the events. I don't think this should be enabled by default yet until it is in upstream k8s. Nice investigation

Comment on lines 20 to 23
return fmt.Errorf(
`pods are not enabled to produce container events,
please enable enable_pod_events of runtime to enabling pods for producing container events`,
)
Copy link
Member

Choose a reason for hiding this comment

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

@harche @sairameshv WDYT? We will fail later anyway so we mine as well return early

@@ -16,7 +17,10 @@ type containerEventConn struct {
// GetContainerEvents sends the stream of container events to clients
func (s *Server) GetContainerEvents(_ *types.GetEventsRequest, ces types.RuntimeService_GetContainerEventsServer) error {
if !s.Config().EnablePodEvents {
return nil
return fmt.Errorf(
`pods are not enabled to produce container events,
Copy link
Member

Choose a reason for hiding this comment

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

can you remove the newline please?
also: suggest a reword:

enable_pod_events is false. Set to true to produce container events

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done 👍🏽

@MdSahil-oss MdSahil-oss changed the title feat: Sets EnablePodEvents of RuntimeConfig true by default refactor: Returning error on calling GetContainerEvents() while enable_pod_events of runtime is disabled Aug 29, 2023
…e_pod_events of runtime is disabled

Signed-off-by: Md Sahil <mohdssahil1@gmail.com>
@MdSahil-oss MdSahil-oss force-pushed the get-container-events branch from 53fd644 to 59f5f15 Compare August 29, 2023 18:37
Copy link
Member

@sairameshv sairameshv left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Aug 30, 2023
@haircommander
Copy link
Member

/ok-to-test
/retest
/approve

@openshift-ci openshift-ci bot 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 Aug 30, 2023
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 30, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: haircommander, MdSahil-oss

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

@openshift-ci openshift-ci bot added approved Indicates a PR has been approved by an approver from all required OWNERS files. release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Aug 30, 2023
@sohankunkerkar
Copy link
Member

/retest

@github-actions
Copy link

A friendly reminder that this PR had no activity for 30 days.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 27, 2023
@sairameshv
Copy link
Member

/retest

@github-actions github-actions bot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Dec 13, 2023
Copy link

A friendly reminder that this PR had no activity for 30 days.

@github-actions github-actions bot added lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Jan 12, 2024
Copy link

A friendly reminder that this PR had no activity for 30 days.

@github-actions github-actions bot added lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Feb 13, 2024
Copy link

A friendly reminder that this PR had no activity for 30 days.

@github-actions github-actions bot added lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Mar 16, 2024
Copy link

A friendly reminder that this PR had no activity for 30 days.

@github-actions github-actions bot added lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Apr 17, 2024
Copy link

A friendly reminder that this PR had no activity for 30 days.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label May 19, 2024
@kwilczynski kwilczynski removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label May 20, 2024
Copy link

A friendly reminder that this PR had no activity for 30 days.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jun 20, 2024
@kwilczynski kwilczynski removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Aug 7, 2024
Copy link

github-actions bot commented Sep 7, 2024

A friendly reminder that this PR had no activity for 30 days.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Sep 7, 2024
@kwilczynski kwilczynski removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Sep 8, 2024
Copy link

github-actions bot commented Oct 9, 2024

A friendly reminder that this PR had no activity for 30 days.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 9, 2024
Copy link
Contributor

openshift-ci bot commented Dec 10, 2024

@MdSahil-oss: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/ci-fedora-integration 59f5f15 link unknown /test ci-fedora-integration
ci/prow/e2e-aws-ovn 59f5f15 link unknown /test e2e-aws-ovn

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

@github-actions github-actions bot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Dec 11, 2024
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. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants