use retry package

This commit is contained in:
Denis Mishin 2023-08-12 23:03:05 -04:00
parent de6d559a08
commit 54369e83e9
9 changed files with 274 additions and 161 deletions

View file

@ -0,0 +1,22 @@
package reconciler
import (
"context"
"fmt"
)
// GetBundles returns the list of bundles that have to be present in the cluster.
func (c *service) RefreshBundleList(ctx context.Context) error {
resp, err := c.config.api.GetClusterResourceBundles(ctx)
if err != nil {
return fmt.Errorf("get bundles: %w", err)
}
ids := make([]string, 0, len(resp.Bundles))
for _, v := range resp.Bundles {
ids = append(ids, v.Id)
}
c.bundles.Set(ids)
return nil
}