Skip to content

Commit

Permalink
store/nats: record nats error and orchestrator to not proceed on a Li…
Browse files Browse the repository at this point in the history
…st() error
  • Loading branch information
joelrebel committed May 15, 2024
1 parent d423cf3 commit ba82b2e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/orchestrator/updates.go
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,8 @@ func (o *Orchestrator) activeConditionsToReconcile(ctx context.Context) ([]*rcty
records, err := o.repository.List(ctx)
if err != nil {
o.logger.WithError(err).Error("condition record lookup error")

return nil, nil
}

// filter condition Kinds and records to be reconciled
Expand Down
2 changes: 2 additions & 0 deletions internal/store/nats.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ var (
kv.WithTTL(10 * 24 * time.Hour), // XXX: we could keep more history here, but might need more storage
}
errBadData = errors.New("bad condition data")
ErrList = errors.New("list query returned error")
)

type natsStore struct {
Expand Down Expand Up @@ -70,6 +71,7 @@ func (n *natsStore) List(ctx context.Context) ([]*ConditionRecord, error) {
found := []*ConditionRecord{}
watcher, err := n.bucket.WatchAll(nats.IgnoreDeletes())
if err != nil {
natsError("bucket.watchAll")
return nil, errors.Wrap(err, "error listing all conditions")
}

Expand Down

0 comments on commit ba82b2e

Please sign in to comment.