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

add start/end logs to outage entries #911

Merged

Conversation

sanchezl
Copy link
Contributor

Add log entries that affect the state of an outage to the outage entry.

@sanchezl
Copy link
Contributor Author

/test e2e-aws-serial

2 similar comments
@sanchezl
Copy link
Contributor Author

/test e2e-aws-serial

@sanchezl
Copy link
Contributor Author

/test e2e-aws-serial

case currentOutage != nil && latestFailure.Start.After(latestSuccess.Start.Time):
// outage ongoing
if len(currentOutage.StartLogs) == 0 || currentOutage.StartLogs[0].Message != latestFailure.Message {
currentOutage.StartLogs = append([]operatorcontrolplanev1alpha1.LogEntry{latestFailure}, currentOutage.StartLogs...)
Copy link
Contributor

Choose a reason for hiding this comment

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

this will produce infinite startlogs, right? We want a cap.

Also, we want EndLogs to always have the last five-ish failures.

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.

// outage ended
currentOutage.End = latestSuccess.Start
outageDuration := currentOutage.End.Sub(currentOutage.Start.Time)
currentOutage.EndLogs = []operatorcontrolplanev1alpha1.LogEntry{latestSuccess}
Copy link
Contributor

Choose a reason for hiding this comment

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

this should be an append.

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.

@deads2k
Copy link
Contributor

deads2k commented Jul 28, 2020

I'm not really happy with the logic, but I need something in CI now. Please update the endlogs and startlogs.

  1. StartLogs should have only five entries ever, after that, nothing more gets added
  2. EndLogs should always have at least one entry (the first failure is the first entry). After that, it should have five entries max, but it should always be the most recent five.

/lgtm

@openshift-ci-robot openshift-ci-robot added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jul 28, 2020
@openshift-bot
Copy link
Contributor

/retest

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

3 similar comments
@openshift-bot
Copy link
Contributor

/retest

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

@openshift-bot
Copy link
Contributor

/retest

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

@openshift-bot
Copy link
Contributor

/retest

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

pickup updated podnetworkconnectivitychecks OutageEntry
@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Jul 29, 2020
@deads2k
Copy link
Contributor

deads2k commented Jul 29, 2020

/lgtm

probably want to factor the append logic out and keep using it. I suspect we may want the lists sorted in opposite directions, but I guess we'll see.

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 29, 2020
@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: deads2k, sanchezl

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-bot
Copy link
Contributor

/retest

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

3 similar comments
@openshift-bot
Copy link
Contributor

/retest

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

@openshift-bot
Copy link
Contributor

/retest

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

@openshift-bot
Copy link
Contributor

/retest

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

@openshift-merge-robot openshift-merge-robot merged commit 215dba6 into openshift:master Jul 29, 2020
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. 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

5 participants