mirror of
https://github.com/pomerium/pomerium.git
synced 2025-08-03 00:40:25 +02:00
zero: report resource bundle reconciliation status (#4618)
* zero: report resource bundle reconciliation status * use latest zero-sdk
This commit is contained in:
parent
58501896f1
commit
680a32494f
4 changed files with 81 additions and 95 deletions
|
@ -135,6 +135,7 @@ func (c *service) syncBundle(ctx context.Context, key string) error {
|
|||
|
||||
result, err := c.config.api.DownloadClusterResourceBundle(ctx, fd, key, conditional)
|
||||
if err != nil {
|
||||
c.ReportBundleAppliedFailure(ctx, key, BundleStatusFailureDownloadError, err)
|
||||
return fmt.Errorf("download bundle: %w", err)
|
||||
}
|
||||
|
||||
|
@ -155,6 +156,7 @@ func (c *service) syncBundle(ctx context.Context, key string) error {
|
|||
|
||||
bundleRecordTypes, err := c.syncBundleToDatabroker(ctx, fd, cached.GetRecordTypes())
|
||||
if err != nil {
|
||||
c.ReportBundleAppliedFailure(ctx, key, BundleStatusFailureDatabrokerError, err)
|
||||
return fmt.Errorf("apply bundle to databroker: %w", err)
|
||||
}
|
||||
current := BundleCacheEntry{
|
||||
|
@ -171,9 +173,12 @@ func (c *service) syncBundle(ctx context.Context, key string) error {
|
|||
|
||||
err = c.SetBundleCacheEntry(ctx, key, current)
|
||||
if err != nil {
|
||||
return fmt.Errorf("set bundle cache entry: %w", err)
|
||||
err = fmt.Errorf("set bundle cache entry: %w", err)
|
||||
c.ReportBundleAppliedFailure(ctx, key, BundleStatusFailureDatabrokerError, err)
|
||||
return err
|
||||
}
|
||||
|
||||
c.ReportBundleAppliedSuccess(ctx, key, result.Metadata)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue