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

fix(events): Adds config flag. Reduce number of dupe events emitted. #3205

Merged
merged 8 commits into from Jun 16, 2020

Conversation

alexec
Copy link
Contributor

@alexec alexec commented Jun 10, 2020

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this is a chore.
  • The title of the PR is (a) conventional, (b) states what changed, and (c) suffixes the related issues number. E.g. "fix(controller): Updates such and such. Fixes #1234".
  • I've signed the CLA.
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My builds are green. Try syncing with master if they are not.
  • My organization is added to USERS.md.

Changes

  • Adds a new flag to disable node events. I'm hoping we won't need this, but just in case.
  • Use EventRecorder to batch events.

Testing

I've not added an e2e test for the flag, because this is not default behaviour. So this must be tested manually.

@alexec alexec changed the title fix(events): Adds config flag. Does not repeat events about successfu… fix(events): Adds config flag. Does not repeat events about successful nodes. Jun 10, 2020
@alexec alexec requested a review from sarabala1979 June 10, 2020 17:46
@@ -0,0 +1,9 @@
package config

type NodeEvents struct {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This might allow for more complex config later on.

@@ -18,6 +18,14 @@ data:
# (available since Argo v2.3)
parallelism: 10

# Whether or not to emit events on node completion. These can take a up a lot of space in
# k8s (typically etcd) resulting in errors when trying to create new events:
# "Unable to create audit event: etcdserver: mvcc: database space exceeded"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I include the specific error message so people Googling for it may find it

@alexec alexec marked this pull request as ready for review June 10, 2020 18:26
@alexec alexec changed the title fix(events): Adds config flag. Does not repeat events about successful nodes. fix(events): Adds config flag. Reduce number of dupe events emitted. Jun 10, 2020
@alexec alexec requested a review from jessesuen June 10, 2020 22:27
command: [sh, -c, sleep 10]
`

func TestEventTimeout(t *testing.T) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this test was garbage - deleted

@alexec alexec added type/bug type/feature Feature request and removed type/bug labels Jun 11, 2020
@alexec
Copy link
Contributor Author

alexec commented Jun 15, 2020

@sarabala1979 do you think you might be able to review this in the next day or two please?

return
}
woc.auditLogger.LogWorkflowEvent(woc.wf, argo.EventInfo{Type: apiv1.EventTypeNormal, Reason: argo.EventReasonWorkflowRunning}, "Workflow Running")
woc.eventRecorder.Event(woc.wf, apiv1.EventTypeNormal, "WorkflowRunning", "Workflow Running")
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 define the constant for EventName/EventType instead of hardcoded string "WorkflowRunning"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I actually inlined the constant as it was only used in one place - no need to be a constant

Copy link
Member

@sarabala1979 sarabala1979 left a comment

Choose a reason for hiding this comment

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

LGTM

@sonarcloud
Copy link

sonarcloud bot commented Jun 16, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

68.4% 68.4% Coverage
0.0% 0.0% Duplication

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/feature Feature request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants