-
Notifications
You must be signed in to change notification settings - Fork 33
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: deletion logic for transformed checks #1143
Conversation
8183a8f
to
ca2ba2b
Compare
cb25ffc
to
f3d067e
Compare
pkg/db/canary.go
Outdated
if !utils.Contains(models.CheckHealthStatuses, status) { | ||
return fmt.Errorf("invalid check health status: %s", status) | ||
} | ||
updates["status"] = status | ||
} | ||
return Gorm.Table("checks"). |
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.
I think we want to insert a new check rather than update the old checks
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.
Do you mean check_status ?
Ie. Insert new check status and mark the existing check as deleted ?
pkg/jobs/canary/canary_jobs.go
Outdated
for _, checkID := range checksToRemove { | ||
strategy := checkIDDeleteStrategyMap[checkID] | ||
var status string | ||
if strategy == "MarkHealthy" { |
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 we use Constants ?
I think ignore should be the default strategy - i.e. do not insert or update anything, just mark as deleted.
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.
👍🏽
85d3161
to
e46566c
Compare
Fixes: https://mission-control.azure.lab.flanksource.com/incidents/0188ba77-539b-f928-9abe-75b84caf97dc and https://mission-control.azure.lab.flanksource.com/incidents/018929f8-be24-2368-7983-a4e47955d5b5