diff --git a/go.mod b/go.mod index ca3bc116..494d44db 100644 --- a/go.mod +++ b/go.mod @@ -48,7 +48,7 @@ require ( github.com/evanphx/json-patch v5.6.0+incompatible github.com/fergusstrange/embedded-postgres v1.25.0 github.com/flanksource/commons v1.24.0 - github.com/flanksource/duty v1.0.528 + github.com/flanksource/duty v1.0.530 github.com/flanksource/is-healthy v1.0.18 github.com/flanksource/ketall v1.1.7 github.com/flanksource/mapstructure v1.6.0 diff --git a/go.sum b/go.sum index d4490388..752998d4 100644 --- a/go.sum +++ b/go.sum @@ -869,8 +869,8 @@ github.com/fergusstrange/embedded-postgres v1.25.0 h1:sa+k2Ycrtz40eCRPOzI7Ry7Ttk github.com/fergusstrange/embedded-postgres v1.25.0/go.mod h1:t/MLs0h9ukYM6FSt99R7InCHs1nW0ordoVCcnzmpTYw= github.com/flanksource/commons v1.24.0 h1:fULNc9Rl9YlJU2qYFFMOALVyBUauaGUaQdDb3qvlgBQ= github.com/flanksource/commons v1.24.0/go.mod h1:bqFwYGdHe1pr3YNBUpnM92s4jCrM9ZJkzZCEwTEdI9U= -github.com/flanksource/duty v1.0.528 h1:2Z14zdteypQQajOWMFCLAdB9xf5riNtALYqdOigwY3M= -github.com/flanksource/duty v1.0.528/go.mod h1:4renLmQZsi9QMFT9xBO+bLxjn5KzJ9PI/iq3Wm2+5Zg= +github.com/flanksource/duty v1.0.530 h1:vZU/3vL8DBg+zxFSm+QlGHQKpl3m357owvE0lD6y5R0= +github.com/flanksource/duty v1.0.530/go.mod h1:4renLmQZsi9QMFT9xBO+bLxjn5KzJ9PI/iq3Wm2+5Zg= github.com/flanksource/gomplate/v3 v3.20.4/go.mod h1:27BNWhzzSjDed1z8YShO6W+z6G9oZXuxfNFGd/iGSdc= github.com/flanksource/gomplate/v3 v3.24.2 h1:WZSriw1MaBhzrDV1IOP9eNsupIPxIHy0yTaMOVhCvsk= github.com/flanksource/gomplate/v3 v3.24.2/go.mod h1:94BxYobZqouGdVezuz6LNto5C+yLMG0LnNnM9CUPyoo= diff --git a/hack/generate-schemas/go.mod b/hack/generate-schemas/go.mod index bb5ee275..55807144 100644 --- a/hack/generate-schemas/go.mod +++ b/hack/generate-schemas/go.mod @@ -5,7 +5,7 @@ go 1.22.2 require ( github.com/flanksource/commons v1.24.0 github.com/flanksource/config-db v0.0.65 - github.com/flanksource/duty v1.0.528 + github.com/flanksource/duty v1.0.530 github.com/spf13/cobra v1.7.0 ) diff --git a/hack/generate-schemas/go.sum b/hack/generate-schemas/go.sum index bc1776d4..30d15612 100644 --- a/hack/generate-schemas/go.sum +++ b/hack/generate-schemas/go.sum @@ -243,8 +243,8 @@ github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2 github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/flanksource/commons v1.24.0 h1:fULNc9Rl9YlJU2qYFFMOALVyBUauaGUaQdDb3qvlgBQ= github.com/flanksource/commons v1.24.0/go.mod h1:bqFwYGdHe1pr3YNBUpnM92s4jCrM9ZJkzZCEwTEdI9U= -github.com/flanksource/duty v1.0.528 h1:2Z14zdteypQQajOWMFCLAdB9xf5riNtALYqdOigwY3M= -github.com/flanksource/duty v1.0.528/go.mod h1:4renLmQZsi9QMFT9xBO+bLxjn5KzJ9PI/iq3Wm2+5Zg= +github.com/flanksource/duty v1.0.530 h1:vZU/3vL8DBg+zxFSm+QlGHQKpl3m357owvE0lD6y5R0= +github.com/flanksource/duty v1.0.530/go.mod h1:4renLmQZsi9QMFT9xBO+bLxjn5KzJ9PI/iq3Wm2+5Zg= github.com/flanksource/gomplate/v3 v3.24.2 h1:WZSriw1MaBhzrDV1IOP9eNsupIPxIHy0yTaMOVhCvsk= github.com/flanksource/gomplate/v3 v3.24.2/go.mod h1:94BxYobZqouGdVezuz6LNto5C+yLMG0LnNnM9CUPyoo= github.com/flanksource/is-healthy v1.0.18 h1:ECOKpPZ6mPLDgQlnNm1XPB0QPxutESV760liBNVd5jo= diff --git a/jobs/sync_upstream.go b/jobs/sync_upstream.go index ef5ca86b..0d72c03f 100644 --- a/jobs/sync_upstream.go +++ b/jobs/sync_upstream.go @@ -36,12 +36,13 @@ var ReconcileConfigs = &job.Job{ Fn: func(ctx job.JobRuntime) error { ctx.History.ResourceType = job.ResourceTypeUpstream ctx.History.ResourceID = api.UpstreamConfig.Host - count, fkFailed, err := upstream.ReconcileSome(ctx.Context, api.UpstreamConfig, ReconcilePageSize, tablesToReconcile...) - if err != nil { - ctx.History.AddError(err.Error()) + summary := upstream.ReconcileSome(ctx.Context, api.UpstreamConfig, ReconcilePageSize, tablesToReconcile...) + ctx.History.AddDetails("summary", summary) + ctx.History.SuccessCount, ctx.History.ErrorCount = summary.GetSuccessFailure() + if summary.Error() != nil { + ctx.History.AddDetails("errors", summary.Error()) } - ctx.History.ErrorCount += fkFailed - ctx.History.SuccessCount += count + return nil }, }