-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
base: main
Are you sure you want to change the base?
Conversation
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 Once the patch is verified, the new status will be reflected by the 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 ReportAttention: Patch coverage is
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 |
301af0c
to
66d53a9
Compare
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 |
66d53a9
to
53fd644
Compare
server/container_events.go
Outdated
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`, | ||
) |
There was a problem hiding this comment.
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
server/container_events.go
Outdated
@@ -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, |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done 👍🏽
…e_pod_events of runtime is disabled Signed-off-by: Md Sahil <mohdssahil1@gmail.com>
53fd644
to
59f5f15
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/ok-to-test |
[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 |
/retest |
A friendly reminder that this PR had no activity for 30 days. |
/retest |
A friendly reminder that this PR had no activity for 30 days. |
A friendly reminder that this PR had no activity for 30 days. |
A friendly reminder that this PR had no activity for 30 days. |
A friendly reminder that this PR had no activity for 30 days. |
A friendly reminder that this PR had no activity for 30 days. |
A friendly reminder that this PR had no activity for 30 days. |
A friendly reminder that this PR had no activity for 30 days. |
A friendly reminder that this PR had no activity for 30 days. |
@MdSahil-oss: The following tests failed, say
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. |
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?