Skip to content

Commit

Permalink
Merge pull request #1256 from flanksource/fix/canary-sync-from-ui
Browse files Browse the repository at this point in the history
fix: canaries created from UI were not being saved
  • Loading branch information
moshloop authored Sep 12, 2023
2 parents 73fe256 + 7d354be commit d8d046e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions pkg/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,10 @@ func FromResult(result CheckResult) CheckStatus {

func FromV1(canary v1.Canary, check external.Check, statuses ...CheckStatus) Check {
canaryID, _ := uuid.Parse(canary.GetPersistedID())
checkID, _ := uuid.Parse(canary.GetCheckID(check.GetName()))

c := Check{
ID: checkID,
Owner: canary.Spec.Owner,
Severity: canary.Spec.Severity,
// DisplayType: check.DisplayType,
Expand Down
2 changes: 1 addition & 1 deletion pkg/cache/postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func (c *postgresCache) AddCheckFromStatus(check pkg.Check, status pkg.CheckStat
return uuid.Nil, nil
}

if !check.Transformed {
if check.ID != uuid.Nil {
return uuid.Nil, nil
}

Expand Down

0 comments on commit d8d046e

Please sign in to comment.